Commit Graph

82 Commits (17bf51a855d981b757299be53cdb3ca488176c5b)

Author SHA1 Message Date
David F. Mulcahey 946544b08f
Update ZHA to use apparent power () 2021-12-29 10:35:17 -05:00
David F. Mulcahey 0062676f61
Add lqi and rssi sensors back to ZHA ()
* update device list

* Only 1 identify button per device

* Add LQI and RSSI sensors to ZHA

* refactor entity creation filter

* update device list and update discover test

* fix reference

* code reduction

* walrus

* parens

* simplify
2021-12-24 16:48:02 -05:00
David F. Mulcahey 94324cebea
Update HVAC action handling in ZHA climate devices ()
* Update HVAC action handling in ZHA climate devices

* fix class name

* align with class name changes

* get the correct sensor entity for state assertions
2021-12-12 12:11:37 -05:00
Alexei Chetroi 997809c6c4
Refactor ZHA entity matching process ()
* Group multi-matches by channels

* Group multi-matched by explicit groups

* Registryless AnalogInput and PowerConfiguration

* Refactor single cluster sensor registry

* Refactor single cluster cover and lock registry

* Refactor single cluster binary_sensor registry

* Pylint
2021-12-12 07:52:49 -05:00
David F. Mulcahey abbde8f128
Clean up state class and device class usage in ZHA ()
* Clean up sensor and device class usage in ZHA

* additional cleanup

* Use EntityCategory
2021-12-11 11:51:24 -05:00
David F. Mulcahey f6ac856b8d
Use async_on_unload from config entry in ZHA ()
* remove DATA_ZHA_DISPATCHERS

* update typing information

* fix rebase
2021-12-11 11:50:03 -05:00
David F. Mulcahey a17031630f
Use Platform enum in ZHA () 2021-12-11 11:06:39 -05:00
Alexei Chetroi 4e9fd56b8c
Add 3157100-E model to Centralite thermostat () 2021-12-05 20:36:05 -05:00
David F. Mulcahey fd8e7ae5d9
Add PPB VOC sensor to ZHA () 2021-12-02 16:05:15 -05:00
Robin Dupont 4598353315
Add apparent_power for ZHA ElectricalMeasurement ()
* Add apparent_power for ZHA ElectricalMeasurement

* Add apparent_power to REPORT_CONFIG

* update device list with apparent_power attribute

* update test decorators for apparent_power

* remove comments

* Add test for apparent_power in test_sensor
2021-11-18 19:43:08 -05:00
Piotr Majkrzak 80f1e8770a
Add Water Content Measurement clusters ()
* Add Water Content Measurement clusters

* Fix typo

* Add device test

Co-authored-by: Alexei Chetroi <lexoid@gmail.com>
2021-11-08 13:13:35 -05:00
Alexei Chetroi cc82976d15
Add Battery sensor regardless if the battery_percent_remaining attribute is supported or not () 2021-11-07 12:53:28 -05:00
Paulus Schoutsen 366a4d24f4
Add entity category to ZHA battery () 2021-10-27 16:28:10 -07:00
Marc Mueller d5116810d4
Use assignment expressions 08 () 2021-10-17 20:02:42 +02:00
Alexei Chetroi 723596076d
Add ZHA HVAC Action sensor ()
* WIP

* Refactor multi-entity matching

Eliminate the notion on primary channel.

* Cleanup climate tests

* Refactor multi-entity match

Remove the "primary channel" in multiple entity matches

* Cleanup

* Add HVAC Action sensor

* Add a "stop_on_match" option for multi entities matches

Nominally working HVAC state sensors

* Add id_suffix for HVAC action sensor

* Fix Zen HVAC action sensor

* Pylint
2021-10-04 12:57:58 -04:00
Alexei Chetroi d0827a9129
ZHA support for additional entities on ElectricalMeasurement ZCL cluster ()
* Add electrical measurement type state attribute.

* Add active_power_max attribute

* Skip unsupported attributes on entity update

* Fix tests

* Create sensor only if the main attribute is supported

* Refactor ElectricalMeasurement sensor to use attr specific divisor and multiplier

* Multiple entities for electrical measurement cluster

* Update discovery tests

* Sensor clean up

* update tests

* Pylint
2021-10-02 21:57:49 -04:00
Alexei Chetroi dbba2c4afe
Add "Summation Delivered" Sensor for SmartEnergy metering ZHA channel () 2021-09-29 09:35:20 -07:00
Erik Montnemery ae507aeed1
Move temperature conversions to sensor base class (8/8) ()
* Move temperature conversions to entity base class (8/8)

* Fix wallbox sensor

* Fix tests
2021-08-11 21:17:16 +02:00
Franck Nijhof d722d13b0e
Add measurement state class to ZHA power devices () 2021-08-02 16:33:27 +02:00
Alexei Chetroi 7f309b4e6e
Add support for Formaldehyde and VOC level sensors () 2021-07-01 07:34:09 -04:00
Erik Montnemery b169a8dbda
Mark battery, humidity and pressure sensors as STATE_CLASS_MEASUREMENT ()
* Mark battery, humidity and pressure sensors as STATE_CLASS_MEASUREMENT

* Fix deconz battery sensor
2021-05-24 11:36:42 +02:00
Erik Montnemery 73d7a754e8
Mark temperature sensors as STATE_CLASS_MEASUREMENT ()
* Mark temperature sensors as STATE_CLASS_MEASUREMENT

* Fix broadlink tests

* Tweak Hue changes
2021-05-21 11:44:34 +02:00
Michael 9eecd90afc
Add constructor return type in integrations T-Z () 2021-05-20 17:00:19 +02:00
Ruslan Sayfutdinov 0301706fc6
Define AddEntitiesCallback type () 2021-04-29 12:28:14 +02:00
jan iversen 9879b7becf
Rename HomeAssistantType to HomeAssistant, integrations w* - z* ()
* Integration zha: HomeAssistantType -> HomeAssistant.

* Integration zerproc: HomeAssistantType -> HomeAssistant.

* Integration xbox: HomeAssistantType -> HomeAssistant.

* Integration wunderground: HomeAssistantType -> HomeAssistant.

* Integration wled: HomeAssistantType -> HomeAssistant.

* Integration water_heater: HomeAssistantType -> HomeAssistant.

* Integration websocket_api: HomeAssistantType -> HomeAssistant.

* Integration wilight: HomeAssistantType -> HomeAssistant.
2021-04-22 11:04:28 -04:00
Abílio Costa 5c7408cdce
Remove uneeded check in ZHA battery voltage attrib () 2021-04-09 21:30:32 -04:00
Erik Montnemery 0c086b5067
Migrate integrations w-z to extend SensorEntity () 2021-03-22 19:50:29 +01:00
Marc Mueller dcca29ef68
Update typing 14 () 2021-03-18 15:08:35 +01:00
Erik Montnemery 1fc8e32d86
Update integrations t-z to override extra_state_attributes() () 2021-03-11 20:16:26 +01:00
B-Hartley ee2658f9e6
Add (some) of ZCL concentration clusters to ZHA component ()
* Update registries.py

Add concentration clusters recently added to zigpy

* Update measurement.py

Add concentration clusters recently added to ZigPy

* Update sensor.py

Add concentration clusters recently added to ZigPy

* Update sensor.py

remove unnecessary tabs

* Update measurement.py

remove unnecessary tabs

* Update sensor.py

Just adding CO and CO2 for now.

* Update registries.py

Just adding CO2 and CO for now.

* Update measurement.py

Just adding CO2 and CO for now

* Update sensor.py

import const CONCENTRATION_PARTS_PER_MILLION

* Update registries.py

removed trailing whitespace

* Update sensor.py

added extra blank lines and removed trailing whitespace

* Update measurement.py

added extra blank lines and removed trailing whitespace

* Update sensor.py

add device classes for CO and CO2
2021-03-08 11:22:13 -05:00
Alexei Chetroi f3c71a69f0
Allow 10mV precision for ZHA battery sensor entities () 2021-03-08 07:37:33 -05:00
Alexei Chetroi 032d569cd1
Add Analog cluster for Lumi plugs () 2020-12-01 14:34:07 -05:00
Alexei Chetroi 54c4e9335f
Refactor ZHA sensor initialization ()
* Refactor ZHA sensors to use cached values after restart

* Get attr from cluster, not channel

* Run cached state through formatter method

* Use cached values for div/multiplier for SmartEnergy channel

* Restore batter voltage from cache

* Refactor sensor to use cached values only

* Update tests

* Add battery sensor test
2020-11-18 21:34:12 -05:00
Philip Allgaier dde6305549
Cleanup unused loggers (components N-Z + tests) () 2020-10-16 21:24:08 -05:00
J. Nick Koston da2f9db62e
Fix async functions accidentally marked as callbacks () 2020-10-10 16:54:36 +02:00
Shulyaka 9b947e08bf
Add ZHA Analog Input cluster for XBee ()
* Add ZHA XBee Analog Input cluster

* Fix manufacturer to Digi
2020-10-06 16:01:51 -04:00
springstan 6c8e0e20fb
Add and use light lux constant in entire code base () 2020-09-23 20:48:01 +02:00
springstan e330468a13
Use pressure constants in code base () 2020-09-19 09:26:08 +02:00
David F. Mulcahey be8aa16170
Don't poll entities for unavailable ZHA devices ()
* Don't poll entities for unavailable ZHA devices

* Update homeassistant/components/zha/entity.py

Co-authored-by: Bas Nijholt <basnijholt@gmail.com>

* cleanup after accepting suggestion

Co-authored-by: Bas Nijholt <basnijholt@gmail.com>
2020-09-07 13:52:00 -04:00
springstan d2b1918e9c
Drop UNIT_ prefix for percentage constant () 2020-09-05 21:09:14 +02:00
David F. Mulcahey d5a03b4d6a
Cleanup async_accept_signal in ZHA () 2020-07-20 07:04:57 -07:00
Alexei Chetroi 5595ef0783
Drop ZHA sensor for Analog/Multistate input clusters () 2020-06-12 06:08:11 -04:00
Franck Nijhof 7653dc947a
Enable pylint unnecessary-pass ()
* Enable pylint unnecessary-pass

* Process review suggestions

* Fix smhi tests
2020-04-05 10:33:07 +02:00
Alexei Chetroi 81cef9a281
Split ZHA device loading and entities adding ()
* Split ZHA device loading and entities adding.
Load zha devices from ZHA gateway, but add entities after integration
was setup.

* Use hass.loop.create_task()
* Split ZHA device initialization from loading.
Restore and initialize ZHA devices separately.

* Use hass.async_create_task()
Load devices prior group initialization.
2020-03-21 13:25:43 -04:00
David F. Mulcahey aa972b0005
Fix handling of attribute reports in ZHA sensors and binary sensors ()
* Update sensor tests.

* Update light tests.

* Update binary_sensor tests.

* Update cover tests.

* Update device tracker tests.

* Update fan tests.

* Update lock tests.

* Update switch tests.

* add sensor attr to sensors

* add sensor attr to binary sensors

* cleanup extra var

Co-authored-by: Alexei Chetroi <alexei.chetroi@outlook.com>
2020-03-13 19:17:50 -04:00
David F. Mulcahey 7127492767
Additional ZHA cleanup ()
* fix double device loading in tests

* change imports

* None is default
2020-03-11 13:37:28 +01:00
David F. Mulcahey 4248893007
Clean up custom polling in ZHA device and light ()
* cleanup timer handle when device is removed

* separate unavailable times for mains vs battery

* better name

* remove light refresh handle when removing light

* remove unused parallel updates

* don't steal HA const for different purpose

* don't flood network every hour for lights

* update test to test both intervals

* add test for light refresh interval

* fix tests

* update test

* put parallel updates back for now...

* fix async_schedule_update_ha_state usage

* review comment

* review comment

* update test - review conversation

* review comments

* await count not call count

* flip some state
2020-03-11 07:17:53 -04:00
David F. Mulcahey e52542c4d7
Allow multiple attribute reads in ZHA ()
* multi attribute reads for lights

* catch specific exceptions

* get attributes

* fix mains powered update

* add guards and use get_attributes

* use debug for read failures

* cleanup

* update return value for read_attributes

* fix on with timed off
2020-03-07 07:33:59 -05:00
Alexei Chetroi 20333703c5
Remove ZHA attribute listening channel ()
* remove AttributeListeningChannel
* pull sleeps
* update signature to fix pylint
2020-03-04 13:11:53 -05:00
springstan f1a0ca7cd3
Add and use percentage constant ()
* Add and use percentage constant

* Fix pylint error and broken test
2020-02-28 11:46:48 -08:00