Commit Graph

74 Commits (567f181a21e60bf2d13ae08640be7adf3c05259c)

Author SHA1 Message Date
Robert Svensson ae4b1967a3
Use pydeconz interface controls for lights (#75261) 2022-07-16 20:56:48 +02:00
Robert Svensson 4a3d047dff
Use pydeconz interface controls for fans (#75156) 2022-07-14 23:53:09 +02:00
Robert Svensson 24ca656372
Migrate deCONZ Group and Scenes to new entity naming style (#74761) 2022-07-09 19:17:50 +02:00
Robert Svensson b590e51f88
Bump deCONZ dependency to v96 (#74460) 2022-07-05 18:54:03 +02:00
Robert Svensson fd89108483
Move add/remove logic of deCONZ groups to gateway class (#73952) 2022-06-29 12:31:50 +02:00
Robert Svensson b3b4707579
Fix deCONZ group state regression (#73907) 2022-06-23 20:26:51 +02:00
Robert Svensson e60b247b51
Simplify setup of deCONZ platforms (#72453) 2022-05-24 20:48:09 -07:00
Robert Svensson 007c6d2236
Streamline setup of deCONZ binary sensor platform (#71820) 2022-05-17 00:04:57 +02:00
Robert Svensson bd8e705252
Streamline setup of deCONZ light platform (#70822) 2022-04-26 16:06:01 -07:00
Robert Svensson fe3fb230be
Streamline setup of deCONZ group platform (#70712) 2022-04-26 11:44:47 +02:00
Robert Svensson 8eae572c93
Mark type "On/Off Switch" as a deCONZ switch entity (#70598)
Convert entity types of light platform to switch platform
2022-04-25 08:25:38 +02:00
Robert Svensson 790beb1346
Move deCONZ light imports to reflect changes in pydeconz (#70469) 2022-04-24 10:27:56 +02:00
Robert Svensson 83fde83279
Move deCONZ group and scene imports to reflect the changes in pydeconz (#70468)
* Move deCONZ scene imports to reflect the changes in pydeconz

* Move deCONZ group imports to reflect the changes in pydeconz

* Use common resourcegroup rather than 5 different imports in gateway
2022-04-24 10:09:58 +02:00
Robert Svensson 678888c65f
deCONZ dependency exports type hints (#70449) 2022-04-22 19:27:47 -10:00
epenet 5ec855e020
Use ColorMode enum in deconz (#70431) 2022-04-22 17:50:00 +02: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
epenet c8df2656b1
Use EntityFeature enum in components (d**) (#69358) 2022-04-06 00:00:37 +02:00
Robert Svensson d6d7f3cb3c
Bump pydeconz to v88 (#69369) 2022-04-05 13:44:04 -07:00
Robert Svensson 283f4555a4
Fix deconz typing (#68143) 2022-03-15 10:51:26 +01:00
Robert Svensson bff91b170f
Complete typing of some platforms of deCONZ integration (#67494) 2022-03-14 19:34:05 +01:00
Robert Svensson dd9b14d5c9
Add Button platform to deCONZ integration (#65700)
* Improve scene platform

* Add button platform, tests and fix tests affected by new entities existing

* Remove unnused property

* Bump dependency to v87
2022-02-16 17:55:30 +01:00
schmyd f135d77a27
Fix deconz light service parameter handling (#62128)
* Only check presence of values, not their content

* Add tests

* Revert "Only check presence of values, not their content"

This reverts commit 046f0ed5fd.

* Validate existence of keys, not their values

* Properly handle cases of missing keys
2021-12-22 09:29:54 +01:00
Robert Svensson 41e341028e
Add typing to deCONZ Fan and Light platforms (#59607) 2021-11-16 12:39:51 +01:00
epenet 8dfa628af0
Use DeviceInfo on components with via_device (A-G) (#58210)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-10-22 12:12:19 +02:00
Robert Svensson 750dd9186e
Improve deCONZ signal strings (#57140) 2021-10-07 12:48:27 +02:00
Robert Svensson 1d643d6da7
Minor improvements to deCONZ light platform (#56953)
Use library constnats for flash and effect
Use attr_effect_list to specify supported effects
Use isinstance to identify if it is light or group
2021-10-03 22:14:28 +02:00
Robert Svensson f224ab6d67
Use isinstance to verify class in deCONZ integration (#56794)
* Don't enable any variants of the daylight sensor entities by default

* Use isinstance rather than doing ZHATYPE compare

* Accidentally removed an import
2021-09-29 21:19:21 +02:00
Robert Svensson bf7c2753d5
deCONZ use siren platform (#56397)
* Add siren.py

* Working siren platform with 100% test coverage

* Also add test file...

* Add test to verify that switch platform cleans up legacy entities now that sirens are their own platform

* Update homeassistant/components/deconz/siren.py

Co-authored-by: jjlawren <jjlawren@users.noreply.github.com>
2021-09-18 21:59:04 +02:00
Robert Svensson 539ef31046
Reflect changes to pydeconz v84 (#56361)
Mostly snake case conversions and typing
But also a change in retry mechanism
Added a more complete set_* call to most types to remove the direct relation to rest API of deCONZ
2021-09-18 09:05:08 +02:00
Robert Svensson fd6b5ed072
Prefer using xy over hs when supported by light (#52883) 2021-07-12 08:17:50 +02:00
Robert Svensson 6352d8fb0e
Use more attr instead of properties in deCONZ integration (#52098) 2021-06-23 21:40:34 +02:00
Robert Svensson e22893a206
Make attestation of supported features easier to read (deCONZ test) (#52096)
Make is_deconz_group a constant
2021-06-22 20:34:25 +02:00
Robert Svensson 6814e9607a
Improve deCONZ lights supported_color_modes and tests (#51933)
* Improve deconz lights tests

* Simplify attribute definition

* Bump pydeconz to v80
2021-06-22 19:29:58 +02:00
Robert Svensson b1022ce84e
Use supported color modes in deCONZ integration (#51656)
* Initial commit everything is working, need to reevaluate tests

* Fix supported color modes and hs_color

* Attest color mode
2021-06-10 08:51:58 +02:00
Robert Svensson fb21affe45
Replace supported_features property with class attribute in deCONZ light entities (#51558)
* Replace supported_features property with class attribute

* attr_supported_features is already set to 0
2021-06-07 12:50:08 +02:00
Robert Svensson 3b64c574e3
Replace local listener implementation to using config_entry.on_unload in deCONZ (#49494) 2021-04-20 08:20:57 -10:00
Erik Montnemery 6c084ae6ce
Update integrations a-e to override extra_state_attributes() (#47756) 2021-03-11 16:51:03 +01:00
Robert Svensson 60e3fce7dc
Convert old deCONZ groups unique ids (#46093)
* Convert old groups unique ids
Work around for walrus operator not working properly :/

* Remove CONF_GROUP_ID_BASE once entities unique id are updated

* Don't use migrate_entry mechanism to update unique_ids of groups

* Remove walrus operator :(

* Fix review comments

* Walrusify assignment to old_unique_id
2021-02-06 14:32:17 +01:00
Robert Svensson 22a6e55e70
Base deCONZ group supported features on the sum of all its lights (#45440) 2021-01-22 23:39:34 +01:00
Robert Svensson 18c7ae9a8b
Fix hs_color crashing when activating scenes in deCONZ on color_temp lights (#45159) 2021-01-22 22:40:22 +01:00
Robert Svensson e2ef9d1afc
Some lights only support hs, like the lidl christmas lights (#44059) 2020-12-09 19:02:44 +01:00
Robert Svensson ac2c01d20c
deCONZ improve options updating entities (#42320) 2020-12-02 16:21:27 +01:00
Robert Svensson 55cbd5aa0d
Track deCONZ lib changes to light based devices (#43366)
* Improve control of covers

* Log backtrace if available

* Do not create entity for controller tool
Binary sensor should use state rather than is_tripped
Add some more tests to lights and sensors

* Bump dependency to v74

* Fix Balloobs comments
2020-11-23 11:37:11 +01:00
Robert Svensson 8c0b39eb9c
No update before adding entity in deCONZ (#41948) 2020-10-16 17:14:26 +02:00
springstan 513f03eb1f
Return attribute dict directly without temporary variable v2 (#41271) 2020-10-06 16:55:16 +02:00
Robert Svensson 552856203b
Clean deCONZ tests to depend less on integration code (#41015) 2020-10-02 11:20:33 +02:00
Robert Svensson c2ed743237
Improve deCONZ platforms (#40986)
* Use platform domain imports with the list of supported platforms

* Remove legacy async_setup_platform from platforms
2020-10-01 19:06:20 +02:00
Robert Svensson 9116061262
Add lock support to deCONZ (#40807)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-10-01 09:50:06 +02:00
Robert Svensson 66a8edb11e
deCONZ fix comments from #40265 (#40640)
* Use set not list

* Events are not entities

* Don't await unload_events

* Remove checks of entities content in tests

* List to set comprehension

* Why is it so hard to remember that sets arent parenthesis...
2020-09-27 11:02:45 +02:00
Robert Svensson 203c556ba3
Improve tracking of existing entities in deconz (#40265)
* Store all entities in dict

* Use stored unique id to select if to create entity or not

* Remove unnecessary init

* Change so same physical sensor doesnt try to create multiple battery sensors
Change so groups get created properly

* Add controls in tests that entities are logged correctly
2020-09-25 22:49:28 +02:00