Commit graph

85 commits

Author SHA1 Message Date
Franck Nijhof c68b259bd3
Cleanup of unused connection_class logic (#49865)
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-04-29 23:12:58 +02:00
Ville Skyttä 153d6e891e
Use config_entries.SOURCE_* constants (#49631) 2021-04-25 11:27:40 +02:00
Paulus Schoutsen 28347e19c5
Fix Hue service being removed on entry reload (#48663) 2021-04-13 09:31:23 -07:00
J. Nick Koston 3f2ca16ad7
Index config entries by id (#48199) 2021-03-21 21:44:29 -07:00
Franck Nijhof 10535018cc
Improve HomeKit discovered Hue config flow (#47729) 2021-03-10 11:20:51 -08:00
Paulus Schoutsen 3ad4c26f98
Allow SSDP discovery modern Hue hubs (#47725) 2021-03-10 19:21:51 +01:00
Erik Montnemery 87e7cebd36
Update tests c-h to use registry async_get (#47652) 2021-03-09 14:31:17 +01:00
Franck Nijhof cc99fd5e32
Fix Hue scene overriding Hue default transition times (#47454) 2021-03-05 09:43:26 -08: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
J. Nick Koston 7ab2d91bf0
Add suggested area to hue (#47056) 2021-02-26 10:35:09 -06:00
J. Nick Koston 6af67c9558
Ensure hue options show the defaults when the config options have not yet been saved (#47067) 2021-02-25 21:58:35 -08:00
Keith Lamprecht fcc14933d0
Add transitiontime to hue scene service (#45785) 2021-02-03 15:42:52 +01:00
Ville Skyttä 2fb3be50ab
Make DeviceRegistry.async_get_device connections arg optional (#44897)
* Make async_get_device connections Optional, default None

* Remove unnecessary async_get_device connections arg usages

Some of these were using an incorrect collection type, which didn't
cause issues mostly just due to luck.
2021-01-07 13:49:45 +01:00
Franck Nijhof 65cf2fcb6f
Drop asynctest (#44746) 2021-01-01 22:31:56 +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
Paulus Schoutsen 5dac3883b0
Stub light profiles (#42232) 2020-10-23 16:28:21 +02:00
Paulus Schoutsen 45345ddc05
Improve handling of ignored entries (#42148) 2020-10-21 10:49:09 +02:00
Philip Allgaier dde6305549
Cleanup unused loggers (components N-Z + tests) (#41982) 2020-10-16 21:24:08 -05:00
fnurgel 366006e0aa
Multiple Hue activate scene (#41353) 2020-10-11 21:01:49 +02:00
Franck Nijhof 8e4710a2a9
Remove deprecated Hue configuration (#39800) 2020-09-08 15:52:04 +02:00
Franck Nijhof 1c2ebdf307
Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
Paulus Schoutsen 67b18aef5b
Fix Hue homekit discovery (#37694)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2020-07-10 09:37:36 -07:00
Franck Nijhof 235298a1b2
Add Hue manual bridge config flow + options flow (#37268)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-07-02 14:12:24 +02:00
Paulus Schoutsen 2af984917e
Use asynctest-mock in most places (#35109)
* Use asynctest-mock in most places

* Fix broken patch in pilight
2020-05-03 11:27:19 -07:00
Paulus Schoutsen ec47216388
Use built-in test helpers on 3.8 (#34901) 2020-04-30 13:29:50 -07:00
Paulus Schoutsen 454c5d824a
Attempt to fix CI (#34800) 2020-04-28 10:31:22 -07:00
Paulus Schoutsen 6fa29d6e2e
Fix Hue brightness values over 127 off by one (#34190) 2020-04-14 13:31:38 +02:00
Paulus Schoutsen ba8ae17487
Fix hue ct (#33791) 2020-04-08 11:31:41 +02:00
Franck Nijhof 528c7f4871
Removal of extraneous parenthesis in tests (#33670)
* Removal of extraneous parenthesis

* Process review suggestions

* Apply suggestions from code review

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-04-05 03:50:30 +02:00
Franck Nijhof 03dd92d51b
Use set literals in tests (#33669) 2020-04-05 02:20:09 +02:00
Paulus Schoutsen 0a3ec6fea1
Correct Hue mireds for lights (#33597) 2020-04-04 14:29:03 -07:00
Eugenio Panadero 71aaf2d809
Add device triggers for Hue remotes (#33476)
* Store device_registry entry id in HueEvent

so it can be retrieved with that key when using device triggers

* Add device_trigger for hue_event from hue remotes

* supporting Hue dimmer switch & Hue Tap
* State mapping and strings are copied from deCONZ

* refactor mock_bridge for hue tests

and also share `setup_bridge_for_sensors`
for test_sensor_base and test_device_trigger.

* Add tests for device triggers with hue remotes

* Remove some triggers
2020-04-01 11:42:22 -07:00
Eugenio Panadero f5cbc9d208
Fire events for hue remote buttons pressed (#33277)
* Add remote platform to hue integration

supporting ZGPSwitch, ZLLSwitch and ZLLRotary switches.

* Ported from custom component Hue-remotes-HASS from @robmarkcole

* Add options flow for hue, to toggle handling of sensors and remotes

* Sensors are enabled by default, and remotes are disabled,
  to not generate any breaking change for existent users.
  Also, when linking a new bridge these defaults are used,
  so unless going explicitly to the Options menu,
  the old behavior is preserved.
* SensorManager stores the enabled platforms and ignores everything else.
* Bridge is created with flags for `add_sensors` and `add_remotes`,
  and uses them to forward entry setup to only the enabled platforms.
* Update listener removes disabled kinds of devices when options are changed,
  so device list is in sync with options, and disabled kinds disappear from HA,
  leaving the enable/disable entity option for individual devices.

* Fix hue bridge mock with new parameters

* Revert changes in hue bridge mock

* Remove OptionsFlow and platform flags

* Extract `GenericHueDevice` from `GenericHueSensor`

to use it as base class for all hue devices, including those without any entity,
like remotes without battery.

* Add `HueBattery` sensor for battery powered remotes

and generate entities for TYPE_ZLL_ROTARY and TYPE_ZLL_SWITCH remotes.

* Remove remote platform

* Add HueEvent class to fire events for button presses

* Use `sensor.lastupdated` string to control state changes
* Event data includes:
  - "id", as pretty name of the remote
  - "unique_id" of the remote device
  - "event", with the raw code of the pressed button
    ('buttonevent' or 'rotaryevent' property)
  - "last_updated", with the bridge timestamp for the button press
* Register ZGP_SWITCH, ZLL_SWITCH, ZLL_ROTARY remotes

* fix removal

* Exclude W0611

* Extract GenericHueDevice to its own module

and solve import tree, also fixing lint in CI

* Store registered events to do not repeat device reg

* Minor cleaning

* Add tests for hue_event and battery entities for hue remotes
2020-03-31 10:27:30 -07:00
Eugenio Panadero 977f1a6916
Fix hue tests that have uncaught exceptions (#33443) 2020-03-31 10:17:09 -05:00
Paulus Schoutsen e71c7e1f5e Fix hue test 2020-02-20 08:11:27 -08:00
Victor Guimarães 93a844b1d5
Hue Group features based on the bulbs in it (#31897)
* Computes the features of a hue group as the union of the features of the bulbs in the group

* Moved create item to a function

* Added test for hue group features
2020-02-17 10:22:34 -08:00
Paulus Schoutsen 81b159f424
Disable Hue groups for new setups (#31713) 2020-02-11 08:50:07 -08:00
Paulus Schoutsen 989dd32258
Hue to retry if hub errors out (#31616)
* Respect semaphore

* Add retries when connection reset

* Also catch OSError from aiohttp when authenticating
2020-02-08 13:20:37 -08:00
Paulus Schoutsen 0d474e1183
Update the update coordinator API to make it easier to use (#31471)
* Update the update coordinator API to make it easier to use

* failed_last_update -> last_update_success
2020-02-06 09:29:29 -08:00
Paulus Schoutsen 481ea0aa5b
Check for known Hue vulnerability (#31494) 2020-02-05 13:57:17 -08:00
Paulus Schoutsen 166d770ddd
Update Hue data fetching (#31338)
* Refactor Hue Lights to use DataCoordinator

* Redo how Hue updates data

* Address comments

* Inherit from Entity and remove pylint disable

* Add tests for debounce
2020-01-31 14:47:40 -08:00
Christian Clauss df7d2b3aeb
Fix typos found by codespell (#31243)
* Fix typos found by codespell

* Fix typos found by codespell

* codespell: Furture  ==> Future

* Update test_config_flow.py

* Update __init__.py

* Spellcheck: successfull  ==> successful

* Codespell: unsuccesful  ==> unsuccessful

* Codespell: cant  ==> can't

* Codespell: firware ==> firmware

* Codespell: mimick  ==> mimic
2020-01-31 08:33:00 -08:00
Franck Nijhof 4571cf01e2 Update Hue existing config entry with discovery data (#31087)
* Update Hue existing config entry with discovery data

* Updated method documentation comments

* Update implementation to match latest dev

* Use named argument for clarity
2020-01-24 09:07:53 -08:00
Paulus Schoutsen 9f20185cee
Fix hue accepting filename (#30924) 2020-01-17 15:38:38 -08:00
Paulus Schoutsen 7da84dca76
Reinstate and deprecate filename option for hue config (#30846) 2020-01-16 11:28:35 -08:00
Martin Hjelmare 030a399b09 Make hue config flow tests more robust (#30678)
* Make hue config flow tests robust

* Fix io on setup

* Update last tests
2020-01-11 20:00:49 -08:00
Paulus Schoutsen 9aa02e35a7
Entity Component to no longer generate automatic groups (#23789) 2020-01-07 17:30:53 +01:00
Ville Skyttä 5216477353
Be consistent with Home Assistant and Hass.io spelling (#30500)
* Be consistent with Home Assistant spelling

* Be consistent with Hass.io spelling
2020-01-05 14:09:17 +02:00
Ville Skyttä d236a19139
Include all SSDP data in discovery info (#28197)
* Include all SSDP data in discovery info

* Use UPnP device description as discovery info, inject some SSDP attrs

* Clean up attribute names

* Adapt existing SSDP flows to changed attribute names

* Prefix all SSDP UPnP attribute name constants with ATTR_UPNP, tweak a bit
2019-12-19 19:28:03 +02:00
Paulus Schoutsen 9c7caaa142
Add option to ignore flows (#30008) 2019-12-18 07:41:01 +01:00