Commit Graph

21 Commits (b78e22e01240a843b9df638794111ffd21730316)

Author SHA1 Message Date
Marcel van der Veldt e1e6925097
Refactor of Hue integration with full V2 support (#58996)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-11-16 11:59:17 -08:00
Paulus Schoutsen 4fe4e65e3e
Add entity category to Hue (#58011) 2021-10-19 12:29:43 +02:00
Erik Montnemery 6de6a5dc14
Move temperature conversions to sensor base class (3/8) (#54469)
* Move temperature conversions to entity base class (3/8)

* Fix FritzBox sensor

* Fix tests
2021-08-12 14:23:56 +02:00
Erik Montnemery b169a8dbda
Mark battery, humidity and pressure sensors as STATE_CLASS_MEASUREMENT (#50924)
* Mark battery, humidity and pressure sensors as STATE_CLASS_MEASUREMENT

* Fix deconz battery sensor
2021-05-24 11:36:42 +02:00
Franck Nijhof 0cbcb9e0d6
Fix Hue overriding property methods, remove ignored typing (#50976) 2021-05-22 20:32:41 -07:00
Erik Montnemery 73d7a754e8
Mark temperature sensors as STATE_CLASS_MEASUREMENT (#50889)
* Mark temperature sensors as STATE_CLASS_MEASUREMENT

* Fix broadlink tests

* Tweak Hue changes
2021-05-21 11:44:34 +02:00
Paulus Schoutsen 646af533f0
Add support for Hue push updates (#50591) 2021-05-14 13:39:57 -07:00
Paulus Schoutsen 17fc962a87
Bump aiohue to 2.3.0 (#50217)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-05-07 14:24:47 +02:00
Erik Montnemery 339a56e434
Migrate integrations f-h to extend SensorEntity (#48212) 2021-03-22 19:45:17 +01:00
Erik Montnemery af4d06b12e
Update integrations f-i to override extra_state_attributes() (#47757) 2021-03-11 16:57:47 +01:00
springstan 6c8e0e20fb
Add and use light lux constant in entire code base (#40171) 2020-09-23 20:48:01 +02:00
springstan d2b1918e9c
Drop UNIT_ prefix for percentage constant (#39383) 2020-09-05 21:09:14 +02: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 94b6ab2862
Use platform tag to register components on hue SensorManager (#32732)
* Use platform tag to register components on hue SensorManager

instead of a boolean flag to decide between sensor and binary sensor,
so it could be used externally (or to get ready for inclusion of other comps)

* Make new item discovery platform agnostic for SensorManager
2020-03-12 18:31:39 -07: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
javicalle 8bdec13bad Move imports in hue component (#28121) 2019-10-22 22:58:57 -07:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
Save me a6a3555684 Add attributs and fix lightlevel inconsistency for LightLevel sensor (#24439)
* Add attributs and fix state level

* Update sensor.py

* Update sensor.py
2019-06-11 10:41:20 -07:00
Paulus Schoutsen 26bf1b2173
Fix Hue sensors returning None value (#23478) 2019-04-27 13:27:17 -07:00
Richard Mitchell 845d81bdae Correct calculation and units of light level values. (#23309) 2019-04-22 21:28:40 -07:00
Richard Mitchell 474ac8b09e Add basic support for native Hue sensors (#22598)
* Add basic support for native Hue sensors

* Update coveragerc

* Simplify attributes

* Remove config option

* Refactor and document device-ness and update mechanism

* Entity docstrings

* Remove lingering config for sensors

* Whitespace

* Remove redundant entity ID generation and hass assignment.

* More meaningful variable name.

* Add new 'not-darkness' pseudo-sensor.

* Refactor sensors into separate binary, non-binary, and shared modules.

* formatting

* make linter happy.

* Refactor again, fix update mechanism, and address comments.

* Remove unnecessary assignment

* Small fixes.

* docstring

* Another refactor: only call API once and make testing easier

* Tests & test fixes

* Flake & lint

* Use gather and dispatcher

* Remove unnecessary whitespace change.

* Move component related stuff out of the shared module

* Remove unused remnant of failed approach.

* Increase test coverage

* Don't get too upset if we're already trying to update an entity before it has finished adding

* relative imports
2019-04-17 22:13:03 -07:00