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
This commit is contained in:
rforro 2022-05-25 01:56:03 +02:00 committed by GitHub
parent 7aca007a9a
commit db815a7504
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 204 additions and 1 deletions

View file

@ -27,6 +27,7 @@ from homeassistant.const import (
PRESSURE_HPA,
TEMP_CELSIUS,
TIME_HOURS,
TIME_MINUTES,
TIME_SECONDS,
VOLUME_CUBIC_FEET,
VOLUME_CUBIC_METERS,
@ -754,3 +755,18 @@ class RSSISensor(Sensor, id_suffix="rssi"):
@MULTI_MATCH(channel_names=CHANNEL_BASIC)
class LQISensor(RSSISensor, id_suffix="lqi"):
"""LQI sensor for a device."""
@MULTI_MATCH(
channel_names="tuya_manufacturer",
manufacturers={
"_TZE200_htnnfasr",
},
)
class TimeLeft(Sensor, id_suffix="time_left"):
"""Sensor that displays time left value."""
SENSOR_ATTR = "timer_time_left"
_attr_device_class: SensorDeviceClass = SensorDeviceClass.DURATION
_attr_icon = "mdi:timer"
_unit = TIME_MINUTES