Commit graph

139 commits

Author SHA1 Message Date
Dorian Benech
2584de6324
Add TICMeter Energy Metering sensors (#107956) 2024-01-13 16:53:53 -05:00
David F. Mulcahey
2ed9397611
Fix assertion error when unloading ZHA with pollable entities (#107311) 2024-01-05 16:53:43 -05:00
David F. Mulcahey
817c71747f
Delay all ZHA polling until initialization of entities has completed (#105814)
* Don't update entities until they are initialized

* fix hass reference

* only establish polling once

* fix log level and small cleanup

* start device availability checks after full initialization of network

* add logging

* clean up sensor polling and class hierarchy

* don't attempt restore sensor cleanup in this PR

* put check back

* fix race condition and remove parallel updates

* add sensor polling test

* cleanup switch polling and add a test

* clean up and actually fix race condition

* update light forced refresh

* only use flag

* unused flag

* reduce diff size

* collapse
2023-12-27 10:25:41 -05:00
Joakim Plate
bb0d082b25
Correctly report unavailable battery for value 255 of percentage (#104566)
* Ignore unavailable battery level for zha

* Adjust unavailable test
2023-12-11 19:17:06 +01:00
Joakim Plate
90687e9794
Standardize zha attribute member name (#102182)
* Correct missed translation

* Standardize on _attribute for zha
2023-10-19 17:34:17 +02:00
Joakim Plate
29e8814d1b
Add translation entiry support (zha) (#101909)
* zha: Add translation to binary sensors

* Add some small test for name

* Add translations for sensors

* Correct some tests

* Adjust summation key

* Add translation keys for button

* Add translation keys to climate

* Add translation keys for cover

* Add translation keys to fan

* Add translations to light

* Add translations for lock

* Add translation keys to number

* Add translationk keys to select

* Add translations for switch entities

* Add translation to alarm control panel

* Map to some more standard device classes

* Use shorter references

* Remove explicit name from identify button

* Correct tests

* Correction after rebase
2023-10-17 21:59:49 +02:00
Joakim Plate
6d457e808f
Remove class argument in favor of class variables (zha) (#102117)
* Drop id_suffix class argument

* Use lowecase attribute
2023-10-16 16:26:03 -05:00
Caius-Bonus
5290396731
ZHA Component: Correct AttributeUpdated signal in Thermostat climate entity, ThermostatClusterHandler and ThermostatHVACAction sensor entity (#101725)
* initial

* change other Thermostat climate entities

* remove AttributeUpdateRecord
2023-10-10 14:23:03 -04:00
puddly
cbb28b6943
Migrate internal ZHA data to a dataclasses (#100127)
* Cache device triggers on startup

* reorg zha init

* don't reuse gateway

* don't nuke yaml configuration

* review comments

* Add unit tests

* Do not cache device and entity registries

* [WIP] Wrap ZHA data in a dataclass

* [WIP] Get unit tests passing

* Use a helper function for getting the gateway object to fix annotations

* Remove `bridge_id`

* Fix typing issues with entity references in group websocket info

* Use `Platform` instead of `str` for entity platform matching

* Use `get_zha_gateway` in a few more places

* Fix flaky unit test

* Use `slots` for ZHA data

Co-authored-by: J. Nick Koston <nick@koston.org>

---------

Co-authored-by: David F. Mulcahey <david.mulcahey@icloud.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-09-11 21:39:33 +02:00
Ville Skyttä
b51c0f6ddc
Remove unnnecessary pylint configs from components [s-z]* (#98925) 2023-08-24 01:25:32 +02:00
Ville Skyttä
2399cd283a
Python 3.10 support cleanups (#98640) 2023-08-21 19:14:07 +02:00
puddly
52a8f01096
Make IKEA fan sensors diagnostic in ZHA (#97747) 2023-08-17 02:15:35 +01:00
Marc Mueller
77f38e33e5
Import names from typing instead of typing_extensions [3.11] (#97065) 2023-07-22 17:03:44 -05:00
puddly
22dfa8797f
Bump ZHA dependencies (#93989)
* Make `find_entity_id` synchronous

* Remove `tries`

* Use new `attribute_updated` event signature

* Validate attributes before creating entities

* Avoid swallowing exceptions when opening covers

* Bump ZHA dependencies

* Add a matcher for Sinope water leak sensors using a non-standard ZCL attribute

* Ensure handler matching is strict, not multi

* Add type annotations for newly-updated functions
2023-06-14 21:42:31 -04:00
Joakim Plate
deaf910a24
Correct zha device classes for voc and pm25 (#94130)
Correct zha device classes
2023-06-06 23:03:59 +02:00
epenet
c475273145
Prevent SensorEntity and RestoreEntity inheritance (#88971) 2023-05-24 12:49:35 +02:00
David F. Mulcahey
2bc2c4a651
Don't poll ZHA electrical measurement sensors unnecessarily (#92330) 2023-05-01 18:32:40 +02:00
puddly
6842cdcb65
Clean up default ZHA entity names (#91841)
* Always use `Light` for lights, including subclasses

* Clean up other platforms

* Add a unit test to ensure all future entity classes have names

* Remove stale `_name`

* Address review feedback and rename `Open` to `Opening`
2023-04-25 19:51:39 -04:00
David F. Mulcahey
9c784ac622
Refactor ZHA (#91476)
* rename channel -> cluster handler

* remove refs to channels and create endpoint class

* remove remaining references to channels

* fix filter

* take in latest changes from #91403

* missed one

* missed a reference
2023-04-19 10:47:07 -04:00
TheJulianJES
47a2598b66
Add Aqara smoke sensor entities to ZHA (#90159)
* Add Aqara smoke sensor entities (WIP)

* Update smoke sensor entities (WIP)

* Drop two init attributes

* Move self-test button

* Remove self-test switch, add icons

* Add smoke sensor dbm entity

* Also add SMOKE device class to linkage alarm

Note: Enable "Linkage alarm" for this
2023-03-28 21:30:56 -04:00
J. Nick Koston
4221433ca6
Account for changed python3.11 enum.IntFlag 0 behavior in zha (#88144) 2023-02-15 11:40:48 -06: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
Marc Mueller
a5d376069a
Add Self typing (2) [mypy 1.0] (#87599) 2023-02-06 23:23:52 -05:00
Paul Bottein
a8b23d7139
Uses PolledSmartEnergySummation for ZLinky (#86960) 2023-01-30 22:10:55 +01:00
TheJulianJES
0cf676d501
Remove unnecessary ZHA AnalogInput sensors for Xiaomi plugs (#86261)
* Remove unnecessary ZHA AnalogInput sensors for Xiaomi plugs

* Remove AnalogInput entities from test
2023-01-25 06:17:33 -05:00
mbo18
29e3d06a42
Add unit and device class to ZHA RSSI sensor (#85390)
* Add unit device class to ZHA RSSI sensor

* Remove unit and device class for LQI

* mypy

* isort

* mypy2

* Update sensor.py
2023-01-23 07:36:21 -05:00
Paul Bottein
c3e27f6812
Add tier summation delivered for Lixee Zlinky TIC (#82602)
* Add tier summation delivered for zlinky

* Improve name case

* Add other tiers and register tier

* Fix smartenergy sensor update

* Account for new reporting configuration in unit tests

* Use cluster ID attributes instead of hardcoding the values

* Use tier names instead of the numeric constants for formatter

* Revert active register tier delivered

* Fix tests

Co-authored-by: puddly <32534428+puddly@users.noreply.github.com>
2023-01-16 10:33:18 -05:00
epenet
829c8e611e
Remove invalid device class for RSSI sensors (#85191)
* Remove invalid device class for RRSI sensors

* Restore state class
2023-01-05 15:30:52 -05:00
TheJulianJES
f740312247
Fix some typos in ZHA comments (#84881)
* Fix copy paste errors

* Fix "setup/set up" usage

* Fix typo

* Fix comment

* Fix copy paste errors

* Remove space at end of comment

* Remove double word

* Fix copy paste errors

* Fix typos

* Apply review suggestion

* Upper-case zha (to ZHA) everywhere

* Review: fix "over rules"

* Review: most/more
2023-01-02 00:20:59 -05:00
MattWestb
0854f29b7c
Fix zha RMS voltage (#84689)
Fix RMS Voltage.

class ElectricalMeasurementRMSVoltage(ElectricalMeasurement, id_suffix="rms_voltage"): is using CURRENT as unit but shall being VOLTAGE.

Fix: https://github.com/home-assistant/core/issues/84537
2022-12-28 09:27:17 -05:00
Maciej Bieniek
a8f09b4063
Round illuminance value in ZHA integration (#84500) 2022-12-23 13:24:15 +01:00
epenet
2f45e6c2ae
Use UnitOfVolumeFlowRate in integrations (#84348) 2022-12-21 11:00:24 +01:00
epenet
d63a1ab511
Use UnitOfPower.BTU_PER_HOUR in zha (#83657) 2022-12-09 15:57:57 +01:00
epenet
e3aca53899
Use new unit enums in zha (#83633)
* Use new unit enums in zha

* Add kPa

* Add kPa
2022-12-09 13:33:08 +01:00
epenet
248d5ff541
Use ApparentPower unit and device class in integrations (#83577) 2022-12-08 20:55:18 +01:00
David F. Mulcahey
5329a679bb
Add Aqara c1 pet feeder support to ZHA (#82340)
* Add Aqara c1 pet feeder support to ZHA

* clean up

* cleanup

* state classes for daily measurements

* cleanups

* cleanups

* restore the refreshing of the inverted value cache

* cleanup
2022-11-21 18:03:17 -05:00
David F. Mulcahey
20d71a869e
Add friendly entity names for ZHA sensors (#80035)
* Add friendly entity names for ZHA sensors

* lowercase 2nd word
2022-10-10 15:40:42 -04:00
epenet
e2568d8375
Import climate constants from root [m-z] (#78020) 2022-09-08 10:34:44 +02:00
epenet
325557c3e9
Use _attr_should_poll in zha entities (#77175) 2022-08-22 21:38:26 -04:00
David F. Mulcahey
3937ac2ca3
Track code coverage for ZHA sensor entities (#76617)
* Track code coverage for ZHA sensor entities

* remove correct entry
2022-08-11 21:13:27 -04:00
Marc Mueller
a3b2b5c328
Add zha typing [classmethods] (#75472) 2022-07-20 12:03:30 +02:00
Arne Mauer
d8030ed9e7
Ikea Starkvind support all models (#74615)
* Add Particulate Matter 2.5 of ZCL concentration clusters to ZHA component

* Fixed black and flake8 test

* New sensors and manufacturer cluster to support IKEA STARKVIND (with quirk)

* Fix multi_match for FilterLifeTime, device_run_time, filter_run_time sensors for Ikea starkvind

* Remove model match because sensors are matched with manufacturer channel

* Update manufacturerspecific.py

* Update number.py
2022-07-07 14:28:33 -04:00
TheJulianJES
b9b6ed33ee
Fix smart energy polling for Tuya plugs (#74640)
* Add PolledSmartEnergySummation to poll summation_delivered for some ZHA plugs

* Remove PolledSmartEnergyMetering, add stop_on_match_group to summation sensors
2022-07-07 14:27:48 -04:00
Arne Mauer
f975d30258
Fix multi_match to match with the IKEA airpurifier channel (#74432)
Fix multi_match for FilterLifeTime, device_run_time, filter_run_time sensors for ikea starkvind
2022-07-05 10:35:05 +02:00
Arne Mauer
fa678d0408
New sensors and manufacturer cluster to support IKEA STARKVIND (with Quirk) (#73450)
* Add Particulate Matter 2.5 of ZCL concentration clusters to ZHA component

* Fixed black and flake8 test

* New sensors and manufacturer cluster to support IKEA STARKVIND (with quirk)

* Isort and codespell fixes

* Instead using the fan cluster, i've created a Ikea air purifier cluster/channel that supports all sensors and fan modes

* update sensors to support the new ikea_airpurifier channel

* Fix black, flake8, isort

* Mylint/mypy fixes + Use a TypedDict for REPORT_CONFIG in zha #73629

* Last fix for test_fan.py

* fix fan test

Co-authored-by: David F. Mulcahey <david.mulcahey@me.com>
2022-06-29 11:44:40 -04:00
epenet
243905ae3e
Fix cover, light, select, sensor, switch type hints in zha (#73770)
* Fix zha sensor type hints

* Fix zha entity type hints

* Fix switch type hints

* Fix light type hints

* Fix cover type hints

* Fix select type hints
2022-06-21 21:04:24 -04:00
epenet
06e45893aa
Remove invalid type definitions in zha (#73596) 2022-06-20 11:28:53 +02:00
Arne Mauer
321394d3e2
Add Particulate Matter 2.5 of ZCL concentration clusters to ZHA component (#72826)
* Add Particulate Matter 2.5 of ZCL concentration clusters to ZHA component

* Fixed black and flake8 test
2022-06-01 18:00:58 -04:00
David F. Mulcahey
60387a417f
Add support for polled Smart Energy Metering sensors to ZHA (#71527)
* Add framework for polled se metering sensors

* add model

* find attr

* type info
2022-05-27 09:43:39 -04:00
rforro
db815a7504
ZHA Add entities for Lidl water valve quirk (#72307)
* init

* added timer number entity

* added write attribute button entity

* fixed missed errors

* minor changes & fixed failing test

* removed icon

* unit and icons
2022-05-24 19:56:03 -04:00