Add SmartThingsAccelCluster to ZHA binary_sensor (#21609)
* Add SmartThingsAccelCluster to binary_sensor * Make corrections per discussion with @dmulcahey * Add missing const to gateway.py * Remove Acceleration from no sensor
This commit is contained in:
parent
4a3b4cf346
commit
e10e27d809
3 changed files with 7 additions and 4 deletions
|
@ -12,7 +12,7 @@ from .core.const import (
|
|||
DATA_ZHA, DATA_ZHA_DISPATCHERS, ZHA_DISCOVERY_NEW, ON_OFF_CHANNEL,
|
||||
LEVEL_CHANNEL, ZONE_CHANNEL, SIGNAL_ATTR_UPDATED, SIGNAL_MOVE_LEVEL,
|
||||
SIGNAL_SET_LEVEL, ATTRIBUTE_CHANNEL, UNKNOWN, OPENING, ZONE, OCCUPANCY,
|
||||
ATTR_LEVEL, SENSOR_TYPE)
|
||||
ATTR_LEVEL, SENSOR_TYPE, ACCELERATION)
|
||||
from .entity import ZhaEntity
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
@ -41,6 +41,7 @@ DEVICE_CLASS_REGISTRY = {
|
|||
OPENING: OPENING,
|
||||
ZONE: get_ias_device_class,
|
||||
OCCUPANCY: OCCUPANCY,
|
||||
ACCELERATION: 'moving',
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -68,6 +68,7 @@ UNKNOWN = 'unknown'
|
|||
OPENING = 'opening'
|
||||
ZONE = 'zone'
|
||||
OCCUPANCY = 'occupancy'
|
||||
ACCELERATION = 'acceleration'
|
||||
|
||||
ATTR_LEVEL = 'level'
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ from .const import (
|
|||
REPORT_CONFIG_ASAP, REPORT_CONFIG_DEFAULT, REPORT_CONFIG_MIN_INT,
|
||||
REPORT_CONFIG_MAX_INT, REPORT_CONFIG_OP, SIGNAL_REMOVE,
|
||||
NO_SENSOR_CLUSTERS, POWER_CONFIGURATION_CHANNEL, BINDABLE_CLUSTERS,
|
||||
DATA_ZHA_GATEWAY)
|
||||
DATA_ZHA_GATEWAY, ACCELERATION)
|
||||
from .device import ZHADevice, DeviceStatus
|
||||
from ..device_entity import ZhaDeviceEntity
|
||||
from .channels import (
|
||||
|
@ -452,7 +452,6 @@ def establish_device_mappings():
|
|||
NO_SENSOR_CLUSTERS.append(
|
||||
zcl.clusters.general.PowerConfiguration.cluster_id)
|
||||
NO_SENSOR_CLUSTERS.append(zcl.clusters.lightlink.LightLink.cluster_id)
|
||||
NO_SENSOR_CLUSTERS.append(SMARTTHINGS_ACCELERATION_CLUSTER)
|
||||
|
||||
BINDABLE_CLUSTERS.append(zcl.clusters.general.LevelControl.cluster_id)
|
||||
BINDABLE_CLUSTERS.append(zcl.clusters.general.OnOff.cluster_id)
|
||||
|
@ -501,6 +500,7 @@ def establish_device_mappings():
|
|||
zcl.clusters.security.IasZone: 'binary_sensor',
|
||||
zcl.clusters.measurement.OccupancySensing: 'binary_sensor',
|
||||
zcl.clusters.hvac.Fan: 'fan',
|
||||
SMARTTHINGS_ACCELERATION_CLUSTER: 'binary_sensor',
|
||||
})
|
||||
|
||||
SINGLE_OUTPUT_CLUSTER_DEVICE_CLASS.update({
|
||||
|
@ -523,7 +523,8 @@ def establish_device_mappings():
|
|||
BINARY_SENSOR_TYPES.update({
|
||||
zcl.clusters.measurement.OccupancySensing.cluster_id: OCCUPANCY,
|
||||
zcl.clusters.security.IasZone.cluster_id: ZONE,
|
||||
zcl.clusters.general.OnOff.cluster_id: OPENING
|
||||
zcl.clusters.general.OnOff.cluster_id: OPENING,
|
||||
SMARTTHINGS_ACCELERATION_CLUSTER: ACCELERATION,
|
||||
})
|
||||
|
||||
CLUSTER_REPORT_CONFIGS.update({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue