Commit Graph

229 Commits (5fdfafd57f1032a2a3ec75380d11fd26ccc5d70b)

Author SHA1 Message Date
epenet 3b83340f6e
Improve get_browse_image type hints in media player (#90057) 2023-03-26 19:54:01 +02:00
epenet 3058cc8d56
Adjust targets type hint in notify platform (#90062) 2023-03-26 19:52:55 +02:00
epenet 6e92dac61f
Adjust pylint plugin for return type inheritance (#90046) 2023-03-26 18:37:26 +02:00
epenet 69a46d4002
Adjust pylint plugin for components fixtures (#90217)
* Adjust pylint plugin for components fixtures

* Adjust components

* Use MagicMock

* Adjust

* Use None
2023-03-26 15:21:19 +02:00
epenet f56bf134d2
Improve browse_media type hints in media player (#90060)
* Improve browse_media type hints in media player

* Adjust components

* Adjust base entity
2023-03-24 21:49:12 -07:00
J. Nick Koston 4ebce9746d
Add schema auto repairs for states tables (#90083) 2023-03-22 10:05:23 -10:00
epenet 292feb4e24
Enable inheritance checks on ExtraStoredData (#90021) 2023-03-21 09:51:05 +01:00
epenet ab4a726e6c
Add tmpdir to known fixtures in pylint (#89844) 2023-03-17 10:22:02 +01:00
epenet ff8b91aeea
Add freezer to known test fixtures in pylint (#89825)
Add freezer to known fixtures in pylint
2023-03-16 22:39:41 -04:00
Jan Bouwhuis 3afc39dbbf
Set default for `hass_config_yaml` fixture to "" (#88608)
Set default for hass_config_yaml fixture to ""
2023-02-22 17:18:11 +01:00
Jan Bouwhuis ebb450c946
Default `hass_config` to contain an empty config (#88515)
* Default hass_config to {}

* Correct type hint
2023-02-21 08:48:44 +01:00
Jan Bouwhuis 4f6a25b470
Allow parameterizing YAML config in tests (#87981)
* Add fixture to parameterize yaml config

* Apply to more tests

* Re-add @fixture label

* Add fixtures to patch yaml content and targets

* Typo

* Improve docstr

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Update references to mock_yaml_configuration

* Apply new fixtures

* Apply to check_config tests

* Follow up comments

* Rename fixtures, update docstr

* Split paths

* Patch load_yaml_config_file instead

* sort

* Fix tests

* improve docst

* Rename fixtures

* sorting

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Improve docstr

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Improve docstr

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Improve docstr

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Improve docstr

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Improve docstr

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Improve docstr

Co-authored-by: Erik Montnemery <erik@montnemery.com>

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-02-20 16:57:12 +01:00
Franck Nijhof 6891eb7ed1
Add support for snapshot testing (#88323)
* Add support for snapshot testing

* Use snapshots in Elgato diagnostics test

* Use snapshots in Elgato sensor test

* Fix flake8 warning

* Slightly improve serialized output

* Remove snapshot naming in elgato sensor tests

* Improve snapshoting of via_device_id in device registry item

* Update pylint typehints plugin for snapshot fixture typing

* Use snapshots in Elgato configflow test

* Use snapshots in Bluetooth repair issue tests
2023-02-17 16:35:55 -05:00
epenet ba23816a0c
Inverse json import logic (#88099)
* Fix helpers and util

* Adjust components

* Move back errors

* Add report

* mypy

* mypy

* Assert deprecation messages

* Move test_json_loads_object

* Adjust tests

* Fix rebase

* Adjust pylint plugin

* Fix plugin

* Adjust references

* Adjust backup tests
2023-02-16 11:37:57 +01:00
epenet ccf44d58cc
Expose DEVICE_CLASS_STATE_CLASSES sensor constant (#88172) 2023-02-15 14:48:27 +01:00
Jan Bouwhuis 950ee34514
Correct typing on hass_storage fixure (#87986)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2023-02-13 12:12:34 +01:00
epenet b7b82b1e3f
Add more type hints to conftest.py (#87842)
* Add more type hints in conftest.py

* Adjust stop_hass

* Adjust mock_integration_frame

* Adjust pylint plugin
2023-02-11 13:48:53 +01:00
epenet 22bfb99db4
Add type hints to requests_mock (#87757) 2023-02-10 11:44:09 +01:00
epenet fac746c974
Improve recorder type hints in tests (#87826)
* Improve recorder type hints in tests

* Add comment

* Adjust comment
2023-02-10 11:11:39 +01:00
Franck Nijhof 6551eb168d
Add common area, device, entity and issue registry test fixtures (#87694) 2023-02-08 16:28:44 +01:00
epenet a4c4f77f73
Add more fixtures to pylint plugin (#87685) 2023-02-08 10:51:09 +01:00
epenet 8f8bdac451
Fix namespace issue in pylint plugin (#87627) 2023-02-07 13:07:21 +01:00
epenet ef6798e854
Add caplog to known fixtures in pylint plugin (#87617) 2023-02-07 11:34:02 +01:00
epenet ea32a2ae63
Check return and mqtt fixtures typing in tests (#87607)
Check return type and mqtt fixtures typing in tests
2023-02-07 10:21:54 +01:00
epenet de807fa782
Ensure __init__ return type is None (#87521)
* Ensure __init__ return type is None

* Remove hass-constructor plugin

* Simplify

* Replace dict with list

* Cleaup pyproject.toml

* Move is_method outside loop

* Adjust loop
2023-02-06 16:25:12 +01:00
epenet f6c76372ce
Ensure hass is typed (#87068)
* Ensure hass is typed

* Adjust pilight

* Adjust homeassistant scene

* Adjust hassio

* Adjust gree

* Adjust google_maps

* Adjust energyzero

* Adjust harmony

* Adjust mobile_app
2023-02-04 12:52:59 -05:00
epenet 7af86fe130
Improve notify type hints (#86685) 2023-01-26 16:23:03 +01:00
Max R 156c815499
Run `flake8` on more files (#85333)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
Co-authored-by: Dave T <17680170+davet2001@users.noreply.github.com>
2023-01-16 20:53:14 +01:00
epenet 1deb4c68f3
Adjust diagnostics return types (#85525)
* Adjust diagnostics return types

* Replace dict with Mapping
2023-01-13 09:17:54 +01:00
Martin Hjelmare 8805a7e555
Fix humidifier enforce type hints (#85148) 2023-01-05 00:58:08 +01:00
epenet d6fc2d9452
Prevent use of deprecated units (#83384)
* Prevent use of deprecated units

* Adjust obsolete util

* More units

* Add FREQUENCY

* Adjust pylint ignore

* Add ELECTRIC (current/potential)

* Add TIME

* Adjust units
2022-12-21 15:24:11 +01:00
Franck Nijhof 9864d9e0d2
Remove str from sensor device class (#83391) 2022-12-08 19:04:58 +01:00
Franck Nijhof d715aa6867
Modernize Image Processing typing (#83405)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2022-12-06 16:35:40 +01:00
Franck Nijhof c507ad86d1
Remove str from cover device class (#83396)
* Remove str from cover device class

* Fix tests
2022-12-06 16:13:29 +01:00
Franck Nijhof ba0d6fe611
Enforce NumberDeviceClass in number entities (#83402) 2022-12-06 14:58:22 +01:00
Franck Nijhof 647469f472
Remove str from media player device class (#83398)
* Remove str from media player device class

* Adjust pylint plugin
2022-12-06 14:57:34 +01:00
Franck Nijhof cb69364ad2
Remove str from binary sensor device class (#83393) 2022-12-06 14:52:26 +01:00
Franck Nijhof 46caefca7b
Remove str from humidifier device class (#83397) 2022-12-06 14:51:23 +01:00
Franck Nijhof 8cdadd1552
Remove str from switch device class (#83400) 2022-12-06 14:50:44 +01:00
Franck Nijhof 91cf2e2792
Remove str from update device class (#83399) 2022-12-06 14:50:19 +01:00
epenet bf3c6e5f58
Enforce VacuumEntityFeature (#82466) 2022-11-22 07:27:27 +01:00
epenet 4134d722da
Enforce WaterHeaterEntityFeature (#82467) 2022-11-22 07:27:09 +01:00
epenet ab26ea06b9
Enforce UpdateEntityFeature (#82465) 2022-11-22 07:16:53 +01:00
epenet ff5f1aee53
Enforce SirenEntityFeature (#82464) 2022-11-22 07:16:29 +01:00
epenet 0cb3ec142e
Enforce RemoteEntityFeature (#82463) 2022-11-22 07:16:03 +01:00
epenet 6f05a74686
Enforce MediaPlayerEntityFeature (#82462) 2022-11-22 07:15:37 +01:00
epenet a225fc456f
Enforce LockEntityFeature (#82461) 2022-11-22 07:15:11 +01:00
epenet 7f1e1ed1d8
Enforce LightEntityFeature (#82460) 2022-11-22 07:14:47 +01:00
epenet d4bd9a0f7e
Enforce HumidifierEntityFeature (#82459) 2022-11-22 07:14:19 +01:00
epenet 12cb17620e
Enforce FanEntityFeature (#82458)
* Enforce FanEntityFeature

* Adjust pylint
2022-11-22 07:13:54 +01:00
epenet 34607d4410
Enforce CoverEntityFeature (#82457)
* Enforce CoverEntityFeature

* Adjust pylint
2022-11-22 07:09:19 +01:00
epenet 48cc3071bb
Enforce ClimateEntityFeature (#82329) 2022-11-22 07:08:53 +01:00
epenet 8b54a0679f
Enforce CameraEntityFeature (#82325) 2022-11-22 07:08:28 +01:00
epenet cec81e137c
Enforce AlarmControlPanelEntityFeature (#82313) 2022-11-21 22:58:36 +01:00
epenet 9d607c8bd5
Adjust type hints for WaterHeaterEntityFeature (#82270) 2022-11-17 15:51:55 +01:00
epenet ced16da576
Adjust type hints for VacuumEntityFeature (#82269) 2022-11-17 15:31:09 +01:00
epenet 3be750812d
Adjust type hints for UpdateEntityFeature (#82268) 2022-11-17 15:17:50 +01:00
epenet 295cd0143c
Adjust type hints for SirenEntityFeature (#82266) 2022-11-17 15:06:26 +01:00
epenet 9b9bdc725f
Adjust type hints for RemoteEntityFeature (#82265) 2022-11-17 15:06:16 +01:00
epenet 18e30e7c06
Adjust type hints for MediaPlayerEntityFeature (#82258) 2022-11-17 13:58:34 +01:00
epenet 8570d3aabe
Adjust type hints for LockEntityFeature (#82256) 2022-11-17 12:47:48 +01:00
epenet dd7bc7971f
Adjust type hints for LightEntityFeature (#82251) 2022-11-17 12:46:42 +01:00
epenet 2453f95b24
Adjust HumidifierEntity type hints (#82248) 2022-11-17 10:58:46 +01:00
epenet 1b80c66195
Adjust type hints for FanEntityFeature (#82241)
* Adjust type hints for FanEntityFeature

* Adjust template default
2022-11-17 10:30:39 +01:00
epenet 17573196c8
Adjust type hints for CoverEntityFeature (#82238) 2022-11-17 08:39:44 +01:00
epenet 39ac2c1101
Adjust type hints for ClimateEntityFeature (#82206) 2022-11-16 21:17:50 +01:00
epenet f952b74b74
Adjust type hints for AlarmControlPanelEntityFeature (#82186) 2022-11-16 17:08:42 +01:00
epenet 5d78632d04
Adjust type hints for CameraEntityFeature (#82191) 2022-11-16 14:44:08 +01:00
epenet 0c79a9a33d
Adjust pylint for IMPERIAL_SYSTEM deprecation (#80874)
* Adjust pylint for IMPERIAL_SYSTEM deprecation

* Use correct location

* Adjust components
2022-10-24 15:25:00 +02:00
epenet bff5d1123f
Deprecate CONF_UNIT_SYSTEM_*** constants (#80320)
* Deprecate CONF_UNIT_SYSTEM_*** constants

* Adjust pylint plugin

* Add tests

* Remove single-use function

* Revert logic change

* Revert "Revert logic change"

This reverts commit 60959a0050.

* Tweak again
2022-10-14 16:50:04 +02:00
epenet 9c3b40dad1
Deprecate conversion utilities (#78957)
* Deprecate utilities

* Deprecate distance and speed

* Add tests

* Adjust pylint

* Simplify temperature deprecation
2022-09-28 19:39:44 +02:00
epenet 4b813f2460
Adjust pylint plugin for tests directory (#78727)
* Add module_name to parametrize

* Add tests for tests directory

* Apply patch from mib1185

* Adjust plugin to allow imports from component being tested
2022-09-19 14:27:21 +02:00
epenet 0dcbc85684
Adjust relative-import plugin for tests (#78742) 2022-09-19 12:57:07 +02:00
epenet 3941290edc
Force root import of const from other components (#78014)
* Force root import of const from other components

* Add missing commit

* Add tests

* Add tests

* Apply suggestion

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>

* Apply suggestion

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2022-09-14 14:07:57 +02:00
epenet b87cd926e7
Fix image-processing type hint (#78426) 2022-09-14 11:13:48 +02:00
epenet f1c7fb7866
Adjust pylint plugin for relative imports (#78277) 2022-09-14 00:11:57 +02:00
epenet 02c9541862
Improve type hints in mailbox (#78353) 2022-09-13 21:55:50 +02:00
epenet 458ddb6f4b
Improve type hints in image-processing (#78351) 2022-09-13 08:39:39 -04:00
epenet bad81c1bc9
Prevent use of deprecated media-player constants (#77937) 2022-09-13 14:20:15 +02:00
epenet 55e59b778c
Add type hints to TTS provider (#78285)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2022-09-12 23:29:55 +02:00
epenet 5e9c0399eb
Add STT checks to pylint plugin (#78284) 2022-09-12 18:58:06 +02:00
epenet 5f2567cd43
Use alphabetical order for platforms in pylint plugin (#78126) 2022-09-10 23:46:30 +02:00
epenet b369c2f54c
Deprecate SUPPORT_* constants for color_mode (#69269)
* Deprecate SUPPORT_* constants for color_mode

* Simplify

Co-authored-by: Erik Montnemery <erik@montnemery.com>

Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-09-09 11:27:16 +02:00
epenet 7ff23506fe
Use new enums in cast (#77946)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2022-09-09 08:57:14 +02:00
epenet 23168434d5
Add pylint directory to black pre-commit (#78011)
Add pylint to black CI
2022-09-08 09:14:58 +02:00
epenet 645f5e5ac1
Introduce new MediaPlayerState StrEnum (#77941)
* Adjust media-player checks in pylint plugin

* Adjust media-player definitions

* Adjust cast signatures

* Adjust play_media signature

* Introduce MediaPlayerState

* Fix cast implementations

* Revert cast changes

* Update hass_enforce_type_hints.py

* Use set

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>

* Fix tests

* Keep unused constants

* Fix test

* Revert tests

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2022-09-07 16:30:22 +02:00
epenet f71313ee1e
Adjust get_scanner pylint checks (#77944) 2022-09-07 10:58:54 +02:00
epenet 9fb0b3995c
Adjust pylint checks for notify get_service (#77606)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2022-09-07 09:44:15 +02:00
epenet 5de95663a9
Introduce new StrEnums in media player (#77872)
* Introduce RepeatMode enum in media player
* Add MediaClass and MediaType
2022-09-06 18:47:34 +02:00
epenet e5ac50fc57
Add BaseNotificationService to pylint checks (#77663)
* Add BaseNotificationService to pylint checks

* Remove comment
2022-09-06 12:18:29 +02:00
epenet 03b4d25564
Add notify get_service to pylint checks (#77643)
Add notify get_service to pylint checks (take 3)
2022-09-06 12:18:15 +02:00
epenet 8ed689fede
Add new rule to enforce relative imports in pylint (#77358)
* Add new rule to enforce relative imports in pylint

* Early return

* Adjust components
2022-08-29 08:55:32 +02:00
epenet 38ca74b547
Adjust pylint plugin for absolute/relative imports (#77219)
* Adjust pylint plugin for absolute/relative imports

* Adjust components

* One more

* Adjust mqtt

* Adjust mqtt.DOMAIN import

* Adjust internal import

* Add tests for valid local component imports

* Adjust relative path check

* Fixes

* Fixes
2022-08-26 14:27:13 +02:00
epenet fb5a67fb1f
Add vacuum checks to pylint plugin (#76560) 2022-08-18 19:22:08 +02:00
epenet c7301a449b
Add switch checks to pylint plugin (#76909) 2022-08-18 14:48:23 +02:00
Erik Montnemery 60c8d95a77
Remove white_value support from light (#76926) 2022-08-18 08:21:05 -04:00
epenet 07ba3c1383
Add update checks to pylint plugin (#76912) 2022-08-18 13:27:05 +02:00
epenet 49c793b1a2
Add scene checks to pylint plugin (#76908) 2022-08-17 18:44:08 +02:00
epenet 27b5ebb9d3
Add RestoreSensor to sensor checks in pylint (#76916) 2022-08-17 18:43:28 +02:00
epenet fc6c66fe6c
Add RestoreEntity to button checks in pylint (#76932) 2022-08-17 18:42:35 +02:00