Add TI router transmit power config entity to ZHA (#81520)

Make TI Router Transmit Power configurable in ZHA
This commit is contained in:
TheJulianJES 2022-11-07 14:54:43 +01:00 committed by GitHub
parent 902e075d58
commit 523c3089f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

View File

@ -161,6 +161,12 @@ class BasicChannel(ZigbeeChannel):
self.ZCL_INIT_ATTRS.copy()
)
self.ZCL_INIT_ATTRS["trigger_indicator"] = True
elif (
self.cluster.endpoint.manufacturer == "TexasInstruments"
and self.cluster.endpoint.model == "ti.router"
):
self.ZCL_INIT_ATTRS = self.ZCL_INIT_ATTRS.copy()
self.ZCL_INIT_ATTRS["transmit_power"] = True
@registries.ZIGBEE_CHANNEL_REGISTRY.register(general.BinaryInput.cluster_id)

View File

@ -19,6 +19,7 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
from .core import discovery
from .core.const import (
CHANNEL_ANALOG_OUTPUT,
CHANNEL_BASIC,
CHANNEL_COLOR,
CHANNEL_INOVELLI,
CHANNEL_LEVEL,
@ -585,6 +586,20 @@ class FilterLifeTime(ZHANumberConfigurationEntity, id_suffix="filter_life_time")
_attr_name = "Filter life time"
@CONFIG_DIAGNOSTIC_MATCH(
channel_names=CHANNEL_BASIC,
manufacturers={"TexasInstruments"},
models={"ti.router"},
)
class TiRouterTransmitPower(ZHANumberConfigurationEntity, id_suffix="transmit_power"):
"""Representation of a ZHA TI transmit power configuration entity."""
_attr_native_min_value: float = -20
_attr_native_max_value: float = 20
_zcl_attribute: str = "transmit_power"
_attr_name = "Transmit power"
@CONFIG_DIAGNOSTIC_MATCH(channel_names=CHANNEL_INOVELLI)
class InovelliRemoteDimmingUpSpeed(
ZHANumberConfigurationEntity, id_suffix="dimming_speed_up_remote"