Commit Graph

77 Commits

Author SHA1 Message Date
Erik Montnemery
f83c8de8d3 Update signature of platforms' async_setup_entry (#138201) 2025-02-10 21:08:03 +01:00
epenet
439a393816 Use runtime_data in deconz (#136412)
* Use runtime_data in deconz

* Adjust master logic

* Simplify

* Move DeconzConfigEntry definition

* More TYPE_CHECKING

* Apply suggestions from code review
2025-01-27 10:16:57 +01:00
epenet
4fcfbd8134 Rename deconz base entity module (#126041)
* Move and rename deconz base entity to separate module

* Cancel rename
2024-09-20 23:40:08 +02:00
epenet
e0a221ba1f Add alias to DOMAIN import in deconz (#125568) 2024-09-09 19:27:06 +02:00
Marc Mueller
f50973c76c Use PEP 695 misc (#117788) 2024-05-20 12:01:49 +02:00
Sid
8e98ba7312 Add first batch of Ruff PYI rules (#115100)
Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
2024-04-07 11:30:50 -10:00
Robert Svensson
506240be10 Streamline naming in deCONZ integration (#111977) 2024-03-18 22:08:06 +01:00
Robert Svensson
e41133e9f0 Remove old update unique id function from deCONZ binary sensor (#112536) 2024-03-15 12:05:45 +01:00
Robert Svensson
ffcbab1c20 Split out deCONZ hub (#112854)
* Rename DeconzGateway to DeconzHub

* Move gateway.py to hub/hub.py
2024-03-10 08:25:12 +01:00
Marc Mueller
0e3945ca6c Add empty line after module docstring [d-f] (#112698) 2024-03-08 14:15:26 +01:00
Erik Montnemery
0c2485bc03 Freeze integration entity descriptions (#105984)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-12-18 16:28:13 -10:00
Franck Nijhof
2c003d8c10 Remove Deconz entity descriptions required fields mixins (#104009) 2023-11-16 16:05:29 +01:00
Erik Montnemery
cc564026fa Move EntityCategory to homeassistant.const (#87792)
* Move EntityCategory to homeassistant.const

* Fix more imports
2023-02-09 20:15:37 +01:00
Franck Nijhof
5e81d28116 Update black to 23.1.0 (#87188) 2023-02-02 18:35:24 +01:00
Aarni Koskela
6021cedb09 deconz: Use partition instead of split where possible (#81804)
* deconz: Use partition instead of split where possible

With a smattering of code deduplication

Split out of #81493

* Update homeassistant/components/deconz/util.py

Co-authored-by: Robert Svensson <Kane610@users.noreply.github.com>

Co-authored-by: Robert Svensson <Kane610@users.noreply.github.com>
2022-11-08 20:54:01 +01:00
Robert Svensson
82d3397a9b Adapt deCONZ binary sensors to entity descriptions (#79486)
Now typing with lambdas work
2022-10-10 21:18:26 +02:00
Robert Svensson
0154a1cecb Improve deCONZ binary sensor classes (#77419) 2022-08-29 08:15:10 +02:00
Robert Svensson
c2f026d0a7 Minor deCONZ clean up (#76323)
* Rename secondary_temperature with internal_temperature

* Prefix binary and sensor descriptions matching on all sensor devices with COMMON_

* Always create entities in the same order

Its been reported previously that if the integration is removed and setup again that entity IDs can change if not sorted in the numerical order

* Rename alarmsystems to alarm_systems

* Use websocket enums

* Don't use legacy pydeconz constants

* Bump pydeconz to v103

* unsub -> unsubscribe
2022-08-06 01:34:27 +02:00
epenet
deff0ad61e Implement generic in Deconz base device (#76015)
* Make DevonzBase a generic

* Adjust alarm_control_panel

* Adjust binary_sensor

* Adjust climate

* More platforms

* Adjust light

* Ignore type-var

* Add space

* Implement recommendation

* Use type: ignore[union-attr]

* Revert "Use type: ignore[union-attr]"

This reverts commit 983443062a.

* Adjust assert

* Adjust lock

* Rename type variables

* type: ignore[union-attr]

* Formatting

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2022-08-01 19:18:29 +02:00
Robert Svensson
e3242d8d16 Move add/remove logic of deCONZ clip sensors to gateway class (#74481) 2022-07-09 23:35:06 +02:00
Robert Svensson
abf67c3153 Normalize deCONZ binary sensor unique IDs (#73657) 2022-06-28 13:45:25 -07: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
301dcaae63 Move deCONZ sensor imports to reflect changes in pydeconz (#70471) 2022-04-23 22:59:51 +03:00
Robert Svensson
678888c65f deCONZ dependency exports type hints (#70449) 2022-04-22 19:27:47 -10:00
Robert Svensson
5258022e45 Improve typing of deCONZ binary_sensor platform (#70003) 2022-04-13 23:08:20 +03:00
Robert Svensson
d6d7f3cb3c Bump pydeconz to v88 (#69369) 2022-04-05 13:44:04 -07:00
Robert Svensson
bff91b170f Complete typing of some platforms of deCONZ integration (#67494) 2022-03-14 19:34:05 +01:00
Robert Svensson
96c4e33b24 Parametrize deCONZ binary sensors (#65012)
* Improve test coverage prior to improving deCONZ binary sensor platform

* Define all relevant binary sensors as DeconzBinarySensorDescription

* Fix review comment

* Allow providing extra update keys if sensor provides extra attributes

* Minor touch up of naming

* Remove duplicate assert
2022-02-04 12:58:07 +01:00
Robert Svensson
55d3de3411 Add binary sensor for smoke alarm test state (#64873) 2022-01-25 17:46:31 +01:00
Robert Svensson
deed5f327c Add low battery binary sensor to deCONZ integration (#64168)
* Make tamper sensor a property sensor

* Add low battery binary sensor as a binary property sensor

* Change according to review comment

* Use value_fn lambda

* Fix comparison

* Specific entity_description typing

* Minimize the code block affected by catching AttributeError

* Update homeassistant/components/deconz/binary_sensor.py

Co-authored-by: Franck Nijhof <frenck@frenck.nl>

* Update homeassistant/components/deconz/binary_sensor.py

Co-authored-by: Franck Nijhof <frenck@frenck.nl>

* Avoid try statement

* Reflect review changes in sensor platform as well

* Store known sensor entities once per device

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2022-01-17 22:35:20 +01:00
Robert Svensson
02cc75997c Change carbon monoxide device class to CO for deCONZ integration (#64185)
* Change carbon monoxide device class from gas to co

* Add device class safety to alarm sensor
2022-01-16 10:06:09 +01:00
epenet
fa38a2d0bf Use new enums in deconz (#61343)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-09 13:23:01 +01:00
Robert Svensson
4642a70651 Add typing to deCONZ Alarm Control Panel and Binary Sensor platforms (#59611)
* Add typing to deCONZ Alarm Control Panel and Binary Sensor platforms

* Address review comments

* Don't use asserts, use # type: ignore[no-any-return]

* Improve lazy typing of dict
2021-11-16 20:01:10 +01:00
Robert Svensson
333c80a694 Assign entity category diagnostics to deCONZ tampering sensors (#58112) 2021-10-20 20:24:11 +02:00
Robert Svensson
3ad3f4e2ba Simplify signalling for updating available property of deCONZ entities (#58078) 2021-10-20 14:59:36 +02:00
Robert Svensson
93ba966808 Add the correct device class to deCONZ Tamper entity (#57834) 2021-10-17 17:45:32 +02:00
Robert Svensson
750dd9186e Improve deCONZ signal strings (#57140) 2021-10-07 12:48:27 +02:00
Robert Svensson
59b1433e5c Additional place to use isinstance rather than do a string compare (#57094) 2021-10-05 09:17:45 +02:00
Robert Svensson
1c1bb057d7 CLIPGenericFlag should be deCONZ sensor not binary sensor (#56901) 2021-10-01 17:10:01 +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
8db0bd3c0e Fix state_class for deCONZ power sensors (#56586)
* Fix state_class for power sensors
Rewrite entity descriptions for binary sensor and sensor platforms

* Remove icon if device_class is specified
2021-09-25 20:54:55 +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
6352d8fb0e Use more attr instead of properties in deCONZ integration (#52098) 2021-06-23 21:40:34 +02:00
Franck Nijhof
258b388f41 Collection of changing entity properties to class attributes (#51248)
* Collection of changing entity properties to class attributes

* Apply suggestions from code review

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

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-05-31 10:50:11 +02:00
Robert Svensson
056f636568 Add tampering sensor to deCONZ integration (#49776) 2021-04-28 20:16:06 +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
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