1
0
mirror of https://github.com/home-assistant/core synced 2024-07-05 17:29:15 +00:00
Commit Graph

375 Commits

Author SHA1 Message Date
Álvaro Fernández Rojas
d8e4f6d6e6
Add QNAP QSW to strict typing (#71603) 2022-05-09 12:57:27 -05:00
Álvaro Fernández Rojas
b9b83c05e9
Add Airzone to strict typing (#71604) 2022-05-09 12:56:59 -05:00
J. Nick Koston
eb77f8db85
Complete strict typing for recorder (#71274)
* Complete strict typing for recorder

* update tests

* Update tests/components/recorder/test_migrate.py

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

* Update tests/components/recorder/test_migrate.py

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

* Remove the asserts

* remove ignore comments

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-05-04 12:22:50 -05:00
J. Nick Koston
e1be6dd34f
Move recorder services to services.py (#71249) 2022-05-03 10:38:44 -07:00
J. Nick Koston
29bda196b5
Break apart recorder into tasks and core modules (#71222) 2022-05-02 21:53:56 -07:00
J. Nick Koston
b8442d9340
Add json decode caching to logbook (#71080) 2022-05-01 19:33:31 -05:00
J. Nick Koston
2d720973ee
Fix incomplete recorder typing (#71158) 2022-05-01 19:53:47 +03:00
Marc Mueller
283c04e424
Improve typing [helpers.entity] (#70890) 2022-04-28 10:52:42 +02:00
Marc Mueller
93cbb331e5
Update Mypy to 0.950 (#70948)
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-04-27 20:49:54 -05:00
Marc Mueller
9a3908d21d
Improve typing [util.logging] (#70894) 2022-04-27 22:26:56 +02:00
Marc Mueller
02ddfd513a
Improve typing [util.location] (#70893) 2022-04-27 17:20:56 +02:00
Marc Mueller
964c764dae
Improve typing [helpers.sun] (#70892) 2022-04-27 17:19:46 +02:00
Marc Mueller
7dfe8591c4
Improve typing [helpers.event] (#70891) 2022-04-27 17:19:06 +02:00
Marc Mueller
c15c22655b
Enable strict typing [fritzbox_callmonitor] (#70815) 2022-04-26 20:39:42 +02:00
Robert Svensson
69f4aeaf42
Enable strict typing of deconz_device (#70341)
* Enable strict typing of deconz_device completing strict typing of deconz integration
2022-04-22 09:19:35 +02:00
ollo69
74b50a8009
Enable AsusWRT strict typing (#70396)
* Enable AsusWRT strict typing

* Fix myPi errors
2022-04-22 10:14:13 +03:00
Glenn Waters
2abe551eef
Complete strict typing for ElkM1 integration (#70334) 2022-04-20 09:04:11 -10:00
Glenn Waters
2a99084911
ElkM1 integration, add strict types to config_flow (#70323) 2022-04-20 10:46:36 -07:00
Robert Svensson
78b02fe0ce
Enable strict typing for deCONZ platforms (#70290) 2022-04-20 09:03:53 +02:00
Glenn Waters
1492ea1fe3
Elk types 4 (#70305) 2022-04-19 16:45:45 -10:00
Glenn Waters
cec2a40602
ElkM1 integration adding types, part 3 (#70214)
* ElkM1 integration adding types, part 3

* Fix default _state value.

* Tweak fan get.

* change get to dict access.
2022-04-19 10:52:46 -10:00
Robert Svensson
7bc9d01520
Enable strict typing for deCONZ platforms cover+lock+siren+switch (#69930) 2022-04-19 18:14:56 +02:00
Robert Svensson
506be5a818
Enable strict typing for deCONZ platforms binary_sensor+fan+logbook+number (#70171) 2022-04-19 10:32:57 +02:00
Glenn Waters
24e817a173
ElkM1 integration add types, part 2 (#70210) 2022-04-17 14:31:37 -10:00
Robert Svensson
b6cf65decb
Improve typing of deCONZ sensor platform (#70161) 2022-04-17 20:58:42 +03:00
Glenn Waters
c80853496d
Improve Elk-M1 Control typing (#69924)
* Add types to __init__.py

* Fixup typing.

* Fix type error.

* Bump lib to fix login error.

Co-authored-by: Shay Levy <levyshay1@gmail.com>
2022-04-16 00:14:45 +03:00
Milan Meulemans
c932407560
Add SENZ OAuth2 integration (#61233) 2022-04-14 15:29:31 -07:00
Robert Svensson
66265b6e9a
Improve typing of deCONZ light platform (#69886)
homeassistant/components/deconz/light.py:66: error: Incompatible types in assignment (expression has type "List[Union[ConfigurationTool, Cover, Fan, Light, Lock, Siren]]", variable has type "Optional[List[Light]]")  [assignment]
homeassistant/components/deconz/light.py:68: error: Item "None" of "Optional[List[Light]]" has no attribute "__iter__" (not iterable)  [union-attr]
homeassistant/components/deconz/light.py:159: error: Item "LightBase" of "Union[Group, LightBase, SensorBase]" has no attribute "color_mode"  [union-attr]
homeassistant/components/deconz/light.py:159: error: Item "SensorBase" of "Union[Group, LightBase, SensorBase]" has no attribute "color_mode"  [union-attr]
homeassistant/components/deconz/light.py:161: error: Item "LightBase" of "Union[Group, LightBase, SensorBase]" has no attribute "color_mode"  [union-attr]
homeassistant/components/deconz/light.py:161: error: Item "SensorBase" of "Union[Group, LightBase, SensorBase]" has no attribute "color_mode"  [union-attr]
homeassistant/components/deconz/light.py:163: error: Item "LightBase" of "Union[Group, LightBase, SensorBase]" has no attribute "color_mode"  [union-attr]
homeassistant/components/deconz/light.py:163: error: Item "SensorBase" of "Union[Group, LightBase, SensorBase]" has no attribute "color_mode"  [union-attr]
homeassistant/components/deconz/light.py:165: error: Item "LightBase" of "Union[Group, LightBase, SensorBase]" has no attribute "brightness"  [union-attr]
homeassistant/components/deconz/light.py:165: error: Item "SensorBase" of "Union[Group, LightBase, SensorBase]" has no attribute "brightness"  [union-attr]
homeassistant/components/deconz/light.py:174: error: Unused "type: ignore" comment
homeassistant/components/deconz/light.py:174: error: Item "LightBase" of "Union[Group, LightBase, SensorBase]" has no attribute "brightness"  [union-attr]
homeassistant/components/deconz/light.py:174: note: Error code "union-attr" not covered by "type: ignore" comment
homeassistant/components/deconz/light.py:174: error: Item "SensorBase" of "Union[Group, LightBase, SensorBase]" has no attribute "brightness"  [union-attr]
homeassistant/components/deconz/light.py:179: error: Unused "type: ignore" comment
homeassistant/components/deconz/light.py:179: error: Item "LightBase" of "Union[Group, LightBase, SensorBase]" has no attribute "color_temp"  [union-attr]
homeassistant/components/deconz/light.py:179: note: Error code "union-attr" not covered by "type: ignore" comment
homeassistant/components/deconz/light.py:179: error: Item "SensorBase" of "Union[Group, LightBase, SensorBase]" has no attribute "color_temp"  [union-attr]
homeassistant/components/deconz/light.py:179: error: Incompatible return value type (got "Union[int, None, Any]", expected "int")  [return-value]
homeassistant/components/deconz/light.py:179: note: Error code "return-value" not covered by "type: ignore" comment
homeassistant/components/deconz/light.py:184: error: Item "LightBase" of "Union[Group, LightBase, SensorBase]" has no attribute "hue"  [union-attr]
homeassistant/components/deconz/light.py:184: error: Item "SensorBase" of "Union[Group, LightBase, SensorBase]" has no attribute "hue"  [union-attr]
homeassistant/components/deconz/light.py:184: error: Unsupported operand types for / ("None" and "int")  [operator]
homeassistant/components/deconz/light.py:184: note: Left operand is of type "Union[int, None, Any]"
homeassistant/components/deconz/light.py:184: error: Item "LightBase" of "Union[Group, LightBase, SensorBase]" has no attribute "saturation"  [union-attr]
homeassistant/components/deconz/light.py:184: error: Item "SensorBase" of "Union[Group, LightBase, SensorBase]" has no attribute "saturation"  [union-attr]
homeassistant/components/deconz/light.py:189: error: Unused "type: ignore" comment
homeassistant/components/deconz/light.py:189: error: Item "LightBase" of "Union[Group, LightBase, SensorBase]" has no attribute "xy"  [union-attr]
homeassistant/components/deconz/light.py:189: note: Error code "union-attr" not covered by "type: ignore" comment
homeassistant/components/deconz/light.py:189: error: Item "SensorBase" of "Union[Group, LightBase, SensorBase]" has no attribute "xy"  [union-attr]
homeassistant/components/deconz/light.py:194: error: Unused "type: ignore" comment
homeassistant/components/deconz/light.py:194: error: Item "SensorBase" of "Union[Group, LightBase, SensorBase]" has no attribute "state"  [union-attr]
homeassistant/components/deconz/light.py:194: note: Error code "union-attr" not covered by "type: ignore" comment
homeassistant/components/deconz/light.py:194: error: Incompatible return value type (got "Union[bool, None, Any]", expected "bool")  [return-value]
homeassistant/components/deconz/light.py:194: note: Error code "return-value" not covered by "type: ignore" comment
homeassistant/components/deconz/light.py:228: error: Item "LightBase" of "Union[Group, LightBase, SensorBase]" has no attribute "set_state"  [union-attr]
homeassistant/components/deconz/light.py:228: error: Item "SensorBase" of "Union[Group, LightBase, SensorBase]" has no attribute "set_state"  [union-attr]
homeassistant/components/deconz/light.py:228: error: Argument 1 to "set_state" of "Group" has incompatible type "**Dict[str, Union[bool, float, int, str, Tuple[float, float]]]"; expected "Union[str, None, Literal['none', 'select', 'lselect']]"  [arg-type]
homeassistant/components/deconz/light.py:228: error: Argument 1 to "set_state" of "Group" has incompatible type "**Dict[str, Union[bool, float, int, str, Tuple[float, float]]]"; expected "Optional[int]"  [arg-type]
homeassistant/components/deconz/light.py:228: error: Argument 1 to "set_state" of "Group" has incompatible type "**Dict[str, Union[bool, float, int, str, Tuple[float, float]]]"; expected "Union[str, None, Literal['colorloop', 'none']]"  [arg-type]
homeassistant/components/deconz/light.py:228: error: Argument 1 to "set_state" of "Group" has incompatible type "**Dict[str, Union[bool, float, int, str, Tuple[float, float]]]"; expected "Optional[bool]"  [arg-type]
homeassistant/components/deconz/light.py:228: error: Argument 1 to "set_state" of "Group" has incompatible type "**Dict[str, Union[bool, float, int, str, Tuple[float, float]]]"; expected "Optional[Tuple[float, float]]"  [arg-type]
homeassistant/components/deconz/light.py:232: error: Item "SensorBase" of "Union[Group, LightBase, SensorBase]" has no attribute "state"  [union-attr]
homeassistant/components/deconz/light.py:245: error: Item "LightBase" of "Union[Group, LightBase, SensorBase]" has no attribute "set_state"  [union-attr]
homeassistant/components/deconz/light.py:245: error: Item "SensorBase" of "Union[Group, LightBase, SensorBase]" has no attribute "set_state"  [union-attr]
homeassistant/components/deconz/light.py:245: error: Argument 1 to "set_state" of "Group" has incompatible type "**Dict[str, Union[bool, int, str]]"; expected "Union[str, None, Literal['none', 'select', 'lselect']]"  [arg-type]
homeassistant/components/deconz/light.py:245: error: Argument 1 to "set_state" of "Group" has incompatible type "**Dict[str, Union[bool, int, str]]"; expected "Optional[int]"  [arg-type]
homeassistant/components/deconz/light.py:245: error: Argument 1 to "set_state" of "Group" has incompatible type "**Dict[str, Union[bool, int, str]]"; expected "Union[str, None, Literal['colorloop', 'none']]"  [arg-type]
homeassistant/components/deconz/light.py:245: error: Argument 1 to "set_state" of "Group" has incompatible type "**Dict[str, Union[bool, int, str]]"; expected "Optional[bool]"  [arg-type]
homeassistant/components/deconz/light.py:245: error: Argument 1 to "set_state" of "Group" has incompatible type "**Dict[str, Union[bool, int, str]]"; expected "Optional[Tuple[float, float]]"  [arg-type]
2022-04-14 23:31:48 +03:00
Robert Svensson
87551b7880
Improve typing of deCONZ climate platform (#69882)
* Improve typing of deCONZ climate platform

homeassistant/components/deconz/climate.py:153: error: Dict entry 0 has incompatible type "str": "bool"; expected "str": "str"  [dict-item]
homeassistant/components/deconz/climate.py:154: error: Dict entry 1 has incompatible type "str": "bool"; expected "str": "str"  [dict-item]
homeassistant/components/deconz/climate.py:176: error: Argument 1 to "get" of "Mapping" has incompatible type "Optional[Literal['off', 'low', 'medium', 'high', 'on', 'auto', 'smart']]"; expected "str"  [arg-type]
homeassistant/components/deconz/climate.py:200: error: Argument 1 to "get" of "Mapping" has incompatible type "Optional[Literal['off', 'auto', 'cool', 'heat', 'emergency heating', 'precooling', 'fan only', 'dry', 'sleep']]"; expected "str"  [arg-type]
homeassistant/components/deconz/climate.py:218: error: Argument 1 to "set_config" of "Thermostat" has incompatible type "**Dict[str, str]"; expected "Optional[int]"  [arg-type]
homeassistant/components/deconz/climate.py:218: error: Argument 1 to "set_config" of "Thermostat" has incompatible type "**Dict[str, str]"; expected "Optional[bool]"  [arg-type]
homeassistant/components/deconz/climate.py:218: error: Argument 1 to "set_config" of "Thermostat" has incompatible type "**Dict[str, str]"; expected "Optional[List[str]]"  [arg-type]
homeassistant/components/deconz/climate.py:225: error: Argument 1 to "get" of "Mapping" has incompatible type "Optional[Literal['holiday', 'auto', 'manual', 'comfort', 'eco', 'boost', 'complex']]"; expected "str"  [arg-type]
homeassistant/components/deconz/climate.py:244: error: Unused "type: ignore" comment
homeassistant/components/deconz/climate.py:250: error: Unused "type: ignore" comment
homeassistant/components/deconz/climate.py:253: error: Unused "type: ignore" comment

* Simplify populating supported_hvac_modes
Fix tests
2022-04-14 23:19:42 +03:00
Robert Svensson
81a55703bf
Improve typing of deCONZ alarm control panel (#69680)
* Improve typing of deCONZ alarm control panel

* Fix review comments
2022-04-11 16:19:54 +02:00
epenet
9231819532
Add type hints to yeelight (#69213) 2022-04-04 10:58:44 +02:00
epenet
db10c313b5
Add type hints to here_travel_time (#69216)
* Add type hints to here_travel_time

* Adjust
2022-04-03 23:14:11 +03:00
epenet
f6ec0a6323
Add type hints to honeywell (#69217) 2022-04-03 22:06:53 +02:00
J. Nick Koston
d75f577b88
Additional strict typing for recorder (#68860) 2022-03-30 09:20:44 -07:00
J. Nick Koston
af6a62ca79
Strict typing for homekit part 1 (#67657)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2022-03-30 11:21:07 +02:00
J. Nick Koston
d7634d1cb1
Additional strict typing for additional recorder internals (#68689)
* Strict typing for additional recorder internals

* revert

* fix refactoring error
2022-03-29 09:45:25 +02:00
J. Nick Koston
225f7a989b
Add strict typing for recorder util (#68681) 2022-03-25 15:03:46 -07:00
G Johansson
67cf053260
Implement config flow for filesize (#67668)
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-03-25 09:30:28 -10:00
J. Nick Koston
c5c34bc0d7
Typing and code quality for recorder history (#68647) 2022-03-24 17:58:38 -07:00
Franck Nijhof
1c2b8ee606
Add typing to Alert integration (#68365) 2022-03-22 14:48:36 +01:00
IceBotYT
a43505a0a3
Add PECO power outage counter integration (#65194)
* Create a new NWS Alerts integration

* Create a new NWS Alerts integration

* Create new PECO integration

* Remove empty keys

* Revert "Create a new NWS Alerts integration"

This reverts commit 38309c5a87.

* Revert "Create a new NWS Alerts integration"

This reverts commit aeabdd37b8.

* Fix test with new mock data

* Add init and sensor to .coveragerc and more tests for config flow

* Small fixes and replacing patch with pytest.raises in testing invalid county

* Add type defs and fix test_config_flow to use MultipleValid instead

* Fix  issues with 'typing.Dict'

* Move API communication to seperate PyPI library

* Switch PyPI library from httpx to aiohttp to allow for passing in websessions

* Commit file changes requested by farmio as listed here: d267e4300a

* Add suggestions requested by farmio as listed here: 586d8ffa42

* Move native_unit_of_measurement from prop to attr

* Update PLATFORMS constant type annotation

Co-authored-by: Matthias Alphart <farmio@alphart.net>

* Add peco to .strict-typing

I am from school so I can't run mypy atm

* Forgot to import Final

* Do as requested [here](https://github.com/home-assistant/core/runs/5070634928?check_suite_focus=true)

* Updated mypy.ini, checks should pass now

* Fix to conform to mypy restrictions https://github.com/home-assistant/core/runs/5072861837\?check_suite_focus\=true

* Fix type annotations

* Fix tests

* Use cast in async_update_data

* Add data type to CoordinatorEntity and DataUpdateCoordinator

* More cleanup from suggestions here: https://github.com/home-assistant/core/pull/65194\#pullrequestreview-908183493

* Fix tests for new code

* Cleaning up a speck of dust

* Remove unused variable from the peco sensor

* Add rounding to percentage, and extra clean-up

* Final suggestions from @farmio

* Update SCAN_INTERVAL to be a little bit faster

* Change the SCAN_INTERVAL to be somewhat near the update interval of the outage map, as noted by farmio

* New UpdateCoordinator typing
2022-03-21 23:56:53 +01:00
Franck Nijhof
073fb40b79
Add update entity platform (#68248)
Co-authored-by: Glenn Waters <glenn@watrs.ca>
2022-03-21 11:02:48 +01:00
G Johansson
89cfb4e86f
Add yale_smart_alarm to strict typing (#68422)
* Add yale_smart_alarm to strict typing

* Type as Any
2022-03-20 19:50:37 +02:00
Franck Nijhof
2686be921c
Remove deprecated (old) Z-Wave integration (#67221)
* Remove deprecated (old) Z-Wave integration

* Mark migration tests as skip, for later cleanup
2022-03-18 13:09:10 +01:00
Marc Mueller
7ab9e5cf0f
Improve sonos error decorator typing (#67199) 2022-03-15 09:24:52 +01:00
Franck Nijhof
57c33a5cf0
Remove deprecated OpenZWave integration (#68054) 2022-03-14 17:33:04 +01:00
Marc Mueller
41df798375
Bump mypy to 0.940 (#68007) 2022-03-11 15:57:38 -08:00
epenet
8260767e8f
Enable basic type checking in upnp (#66253)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-03-08 07:51:23 +01:00
Joakim Sørensen
6b3b21bcfd
Revert "Add update integration (#66552)" (#67641) 2022-03-07 15:52:15 -08:00
Steve Easley
ea82f2e293
Add Kaleidescape integration (#67711) 2022-03-08 00:16:43 +01:00