Manufacturer specific channel for SmartThings. (#25739)
* Manufacturer specific channel for SmartThings. * Lint.pull/25724/head^2
parent
e0be4efe3e
commit
c3c45f8198
|
@ -6,4 +6,35 @@ https://home-assistant.io/components/zha/
|
|||
"""
|
||||
import logging
|
||||
|
||||
from . import AttributeListeningChannel
|
||||
from .. import registries
|
||||
from ..const import REPORT_CONFIG_ASAP, REPORT_CONFIG_MAX_INT, REPORT_CONFIG_MIN_INT
|
||||
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@registries.ZIGBEE_CHANNEL_REGISTRY.register(registries.SMARTTHINGS_HUMIDITY_CLUSTER)
|
||||
class SmartThingsHumidity(AttributeListeningChannel):
|
||||
"""Smart Things Humidity channel."""
|
||||
|
||||
REPORT_CONFIG = [
|
||||
{
|
||||
"attr": "measured_value",
|
||||
"config": (REPORT_CONFIG_MIN_INT, REPORT_CONFIG_MAX_INT, 50),
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
@registries.ZIGBEE_CHANNEL_REGISTRY.register(
|
||||
registries.SMARTTHINGS_ACCELERATION_CLUSTER
|
||||
)
|
||||
class SmartThingsAcceleration(AttributeListeningChannel):
|
||||
"""Smart Things Acceleration channel."""
|
||||
|
||||
REPORT_CONFIG = [
|
||||
{"attr": "acceleration", "config": REPORT_CONFIG_ASAP},
|
||||
{"attr": "x_axis", "config": REPORT_CONFIG_ASAP},
|
||||
{"attr": "y_axis", "config": REPORT_CONFIG_ASAP},
|
||||
{"attr": "z_axis", "config": REPORT_CONFIG_ASAP},
|
||||
]
|
||||
|
|
|
@ -16,9 +16,6 @@ from homeassistant.components.switch import DOMAIN as SWITCH
|
|||
|
||||
from .const import (
|
||||
CONTROLLER,
|
||||
REPORT_CONFIG_ASAP,
|
||||
REPORT_CONFIG_MAX_INT,
|
||||
REPORT_CONFIG_MIN_INT,
|
||||
SENSOR_ACCELERATION,
|
||||
SENSOR_BATTERY,
|
||||
SENSOR_ELECTRICAL_MEASUREMENT,
|
||||
|
@ -140,23 +137,6 @@ def establish_device_mappings():
|
|||
}
|
||||
)
|
||||
|
||||
CLUSTER_REPORT_CONFIGS.update(
|
||||
{
|
||||
SMARTTHINGS_ACCELERATION_CLUSTER: [
|
||||
{"attr": "acceleration", "config": REPORT_CONFIG_ASAP},
|
||||
{"attr": "x_axis", "config": REPORT_CONFIG_ASAP},
|
||||
{"attr": "y_axis", "config": REPORT_CONFIG_ASAP},
|
||||
{"attr": "z_axis", "config": REPORT_CONFIG_ASAP},
|
||||
],
|
||||
SMARTTHINGS_HUMIDITY_CLUSTER: [
|
||||
{
|
||||
"attr": "measured_value",
|
||||
"config": (REPORT_CONFIG_MIN_INT, REPORT_CONFIG_MAX_INT, 50),
|
||||
}
|
||||
],
|
||||
}
|
||||
)
|
||||
|
||||
DEVICE_CLASS[zha.PROFILE_ID].update(
|
||||
{
|
||||
SMARTTHINGS_ARRIVAL_SENSOR_DEVICE_TYPE: DEVICE_TRACKER,
|
||||
|
|
Loading…
Reference in New Issue