381 Commits

Author SHA1 Message Date
Robert Svensson
333f5da036
Use websocket fixture in deCONZ binary sensor tests (#47820)
Localize test data
Improve asserts
2021-03-18 09:51:42 +01:00
Robert Svensson
786cbcc1d6
Introduction of deCONZ websocket fixture (#47812) 2021-03-12 12:03:29 -08:00
Robert Svensson
6b03c8d126
Improve deCONZ init tests (#47825)
Use patch.dict rather than deep copy to change DECONZ_WEB_REQUEST
2021-03-12 12:02:15 -08:00
Erik Montnemery
87e7cebd36
Update tests c-h to use registry async_get (#47652) 2021-03-09 14:31:17 +01:00
Ville Skyttä
dc880118a4
Lint suppression cleanups (#47248)
* Unused pylint suppression cleanups

* Remove outdated pylint bug references

* Add flake8-noqa config and note to run it every now and then

* Add codes to noqa's

* Unused noqa cleanups
2021-03-02 09:02:04 +01:00
Robert Svensson
6b0c569a70
Normally there should only be one battery sensor per device from deCONZ. (#46761)
With these Danfoss devices each endpoint can report its own battery state.
2021-02-25 09:54:46 +01:00
Jan-Willem Mulder
75b37b4c2a
Expose locked attribute in deCONZ climate platform (#46814) 2021-02-22 07:53:58 +01:00
Robert Svensson
20f45f8ab9
Improve deCONZ tests by using aioclient_mock rather than patching web requests (#45927)
* Don't patch web requests, use aioclient_mock instead

* Remove stale prints

* Remove tests for old way of loading platforms

* Remove unused imports
2021-02-09 08:31:29 +01:00
Paulus Schoutsen
9e07910ab0
Mark entities as unavailable when they are removed but are still registered (#45528)
* Mark entities as unavailable when they are removed but are still registered

* Add sync_entity_lifecycle to collection helper

* Remove debug print

* Lint

* Fix tests

* Fix tests

* Update zha

* Update zone

* Fix tests

* Update hyperion

* Update rfxtrx

* Fix tests

* Pass force_remove=True from integrations

Co-authored-by: Erik <erik@montnemery.com>
2021-02-08 10:45:46 +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
434b4dfa58
Improve deCONZ logbook to be more robust in different situations (#46063) 2021-02-05 23:07:12 +01:00
Robert Svensson
622906965d
Add better message to deCONZ event logbook when information is available (#45545)
* Add better message when information is available

* Fix pylint
2021-01-26 08:15:39 +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
57fa7f926a
Introduce reauth flow to deCONZ (#45443) 2021-01-22 23:37:16 +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
aaf4cd4a25
Basic logbook support for deCONZ events (#45400)
* Basic logbook support

* Improve formulation of message

* Improve typing
2021-01-22 22:39:11 +01:00
Franck Nijhof
65cf2fcb6f
Drop asynctest (#44746) 2021-01-01 22:31:56 +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
bc83e30761
Fix device refresh service can always add devices (#43950) 2020-12-05 11:53:43 +01:00
Robert Svensson
a8f0ad1dd8
Allow creating deCONZ config entry even when no bridge id is available 2020-12-02 19:10:47 +01:00
Robert Svensson
6e8efe2b67
Add fan support to deCONZ climate platform (#43721) 2020-12-02 18:08:46 +01:00
Robert Svensson
25db1dac23
Add preset support to deCONZ climate platform (#43722) 2020-12-02 17:14:05 +01:00
Robert Svensson
1faef0a4d4
Make simple deCONZ thermostats work (#43781) 2020-12-01 18:49:58 +01:00
Robert Svensson
6fa3e287da
Add support to control cooling in deCONZ climate platform (#43720)
* Add fan support

* Add HVAC cool support

* Fix Martins comment from #43607

* Add preset support

* Improve climate test coverage

* Remove fan support

* Remove preset support

* Remove last preset piece
2020-11-28 13:11:13 +01:00
Paulus Schoutsen
b3be708db6
Add default config if not there (#43321)
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-11-25 15:10:04 +01:00
Robert Svensson
acb94b0b59
Add tilt support to deCONZ covers (#43607) 2020-11-24 21:42:11 +01:00
Robert Svensson
7214d6517a
Fix conversion of cover position between HASS and deCONZ (#43602) 2020-11-24 14:47:56 +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
ffe0c1cd58
Add device id to deconz_event (#43552) 2020-11-23 09:22:44 +01:00
Paulus Schoutsen
5dac3883b0
Stub light profiles (#42232) 2020-10-23 16:28:21 +02:00
Robert Svensson
c6c617ed31
Improve device registry for host and deCONZ service (#41786) 2020-10-17 11:44:23 -05:00
Robert Svensson
7eb532ddd0
Improve imports in deCONZ tests (#41976)
* Improve imports in deconz tests

* Add spacing
2020-10-17 11:20:06 -05:00
Robert Svensson
85ccff28cd
Revert partial changes to deCONZ integration from earlier PR (#41943) 2020-10-16 14:38:12 +02:00
Robert Svensson
cb6d3b590e
Revert device trigger modelid for Trådfri remotes for deCONZ (#41843) 2020-10-14 23:39:00 +02:00
Robert Svensson
dc71b7421c
Improve deCONZ climate platform handling unsupported commands (#41780)
* Improve deCONZ climate platform

* Raise valueerror if missing input

* Fix linting
2020-10-13 22:11:09 +02:00
Robert Svensson
267d97e80e
Improve deCONZ fan platform handling unsupported commands (#41779)
* Improve handling unsupported commands

* Raise valueerror on unsupported speed

* Fix linting
2020-10-13 19:34:33 +02:00
Robert Svensson
72289b8171
Add fan support to deCONZ (#40806)
* Add fan support to deconz

* Fix gateway test

* Fix lint issue

* Apply suggestions from code review

* Fix black

* Improve tests

* Store previously used speed in case turn_on service is called without a speed attribute

* Fix tests

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-10-13 12:57:42 +02:00
Ville Skyttä
66aa55dddf
Fix deCONZ IKEA TRÅDFRI device name spelling (#41574) 2020-10-10 13:04:00 +02:00
Robert Svensson
cbb4324c84
Refactor deCONZ tests (#41362)
* Use hass.config_entries.async_unload

* Return config_entry from setup_deconz_integration
2020-10-06 23:25:57 +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
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
2922d4675f
Abort deCONZ config flow if no radio hardware is connected (#40811) 2020-10-01 09:23:12 +02:00
Robert Svensson
9d56d3bb31
Add deCONZ service to clean up orphaned device and entity entries (#40629)
* Add service that can clean up by deCONZ orphaned entries from device and entity registry

* Fix existing tests

* Add new test

* Add some inline comment to the service
2020-09-30 20:11:41 +02:00
Robert Svensson
7e58bfe01d
Add deconz option to disable automatic addition of new devices (#40545)
* Allow disabling automatic additions of new devices from deconz

* Fix black

* Fix review comment

* Remove assertion

* Verify entity registry is empty
2020-09-29 11:07:19 +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
springstan
6a7caad8dc
Use content type json constant (#40312) 2020-09-23 20:21:55 +02:00
Dan Klaffenbach
74cef6966d
Expose angle and xy attributes in deCONZ event if present (#39822)
These attribute are used by the color wheel on the Müller Licht tint
remote control.
2020-09-15 21:13:17 +02:00
Robert Svensson
ceeea52915
Improve handling of mireds being far out of spec (#40018) 2020-09-13 16:31:39 +02:00
Paulus Schoutsen
6de02fc1b9
Fix some more usages of asynctest (#39570) 2020-09-02 14:53:07 +02:00