Commit Graph

209 Commits

Author SHA1 Message Date
Marc Mueller 816ce116bf
Remove unnecessary functools.cached_property backport (#114239) 2024-04-04 11:24:26 +02:00
Marc Mueller 3929273b41
Allow float for int argument type [pylint plugin] (#114105) 2024-03-27 11:51:27 +01:00
Marc Mueller 44eeb2eb5e
Allow Humidifier.current_humidity to be a float (#111297)
* Allow Humidifier.current_humidity to be a float

* Code review

* Allow climate humidity values to be float

* Update demo integration
2024-03-27 11:19:20 +01:00
Joost Lekkerkerker cddce0ce0d
Enable more SIM ruff rules (#113015)
* SIM101 SIM103

* SIM107 SIM109

* SIM110

* SIM112 SIM113

* SIM115

* SIM116

* Fix

* Fix

* Fix
2024-03-10 23:20:37 -04:00
Marc Mueller 19ab3d6daf
Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
Erik Montnemery 3a5e0c14bf
Remove config flow specifics from FlowResult (#111932)
* Remove config flow specifics from FlowResult

* Improve docstring

* Update pylint rules
2024-03-01 13:07:13 +01:00
Erik Montnemery a0e558c457
Add generic classes BaseFlowHandler and BaseFlowManager (#111814)
* Add generic classes BaseFlowHandler and BaseFlowManager

* Migrate zwave_js

* Update tests

* Update tests

* Address review comments
2024-02-29 16:52:39 +01:00
Jan-Philipp Benecke 1c5be598f5
Run pylint sorted platform check also when platform has type annotations (#111407) 2024-02-25 21:18:07 +01:00
Jan-Philipp Benecke 95aea1488d
Add pylint plugin to check if coordinator is placed in its own module (#108174)
* Add pylint plugin to check if coordinator is placed in its own module

* Remove unintended changes

* Remove pylint disable and let CI only fail on W,E,F

* Make check conventional

* Apply review suggestion

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Use option instead

* Remove pylint arguments from pre-commit

* Partially revert "Remove pylint disable and let CI only fail on W,E,F"

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-01-29 10:30:19 +01:00
Jan-Philipp Benecke 28281523ec
Add pylint plugin to check for sorted platforms list (#108115) 2024-01-16 09:47:53 +01:00
Erik Montnemery 0ec3a222e3
Remove device_state_attributes property from entity base class (#105650) 2023-12-14 08:33:56 +01:00
Erik Montnemery 9020dbb093
Remove context_recent_time property from entity base class (#105652) 2023-12-14 08:33:31 +01:00
Allen Porter af9cae289f
Change todo move API to reference previous uid (#102795) 2023-10-26 18:43:10 +02:00
Allen Porter 5d430f53cd
Add todo component (#100019) 2023-10-23 22:53:00 +02:00
Marc Mueller f248b693d7
Update pylint to 3.0.0 (#101282) 2023-10-02 20:12:43 +02:00
Marc Mueller 37288d7788
Add pylint plugin to check for calls to base implementation (#100432) 2023-09-18 13:39:36 -05:00
Franck Nijhof 30058297cf
Migrate backported StrEnum to built-in StrEnum (#97101) 2023-07-23 23:19:24 +02:00
Franck Nijhof 21bdcd6b63
Remove str as a valid HVACMode & HVACAction type (#94644)
* Remove str as a valid HAVCMode type

* Adjust pylint plugin

* Also remove str from hvac_action property method
2023-06-15 20:16:17 +02:00
Erik Montnemery 334dacc322
Change Entity.name default to UNDEFINED (#94574)
* Change Entity.name default to UNDEFINED

* Update typing

* Update Pylint plugin

* Update TTS test
2023-06-15 11:09:53 +02:00
Jan Bouwhuis ec98e22330
Add type hints for stub_blueprint_populate fixture (#93568)
Add typehints for stub_blueprint_populate fixture
2023-05-26 08:13:13 +02:00
Erik Montnemery 30d9d7d905
Minor adjustment of tts typing (#93450) 2023-05-24 21:02:55 +02:00
epenet 6057aeee2f
Prevent NumberEntity and RestoreEntity inheritance (#93467) 2023-05-24 20:59:14 +02:00
epenet c475273145
Prevent SensorEntity and RestoreEntity inheritance (#88971) 2023-05-24 12:49:35 +02:00
Jan Bouwhuis bb15923968
Rename MQTT entry mock and cleanup (#91223)
Rename to mqtt_mock_entry and cleanup
2023-04-12 09:43:03 +02:00
epenet 611d4135fd
Add ComponentProtocol to improve type checking (#90586) 2023-03-31 14:19:58 -04:00
epenet 1937d803c5
Add RestoreEntity pylint checks to all platforms (#90020) 2023-03-27 20:08:20 +02:00
epenet c193402ba7
Remove incorrect ignore in pylint plugin (#90024)
* Remove incorrect ignore_missing_annotations

* Allow tuple[int, int] in hs_color

* Adjust notify targets

* Always check for return type inheritance

* Adjust tests

* Revert "Always check for return type inheritance"

This reverts commit 3528742adf98edc6481f2c954c032ace881e1d6e.

* Revert "Allow tuple[int, int] in hs_color"

This reverts commit d51c1731eff3d59b9e94e7a7e914933ceaf8e34f.

* Revert "Adjust notify targets"

This reverts commit 4cba77a7309dc89980e29d6d5b9107d9e55f7070.
2023-03-27 13:53:14 +02:00
epenet 53de9dcdbc
Fix pylint plugin for binary websocket (#90351) 2023-03-27 13:09:42 +02:00
epenet 94a52d5cca
Adjust tts default_options type hints (#90053)
* Adjust tts default_options type hints

* Improve other components

* Adjust

* Revert component changes

* Adjust get_tts_audio in amazon_polly
2023-03-27 11:00:23 +02:00
epenet c075dac916
Fix pylint plugin for tuple[float, float] returns (#90047) 2023-03-26 19:54:21 +02:00
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