Use problem, presence and plug device class constants in various integrations (#39973)
This commit is contained in:
1 parent
3d4ef8cfe1
commit
827711bcd1
5 files changed
+35
-13
No files matched your search
@@ -5,6 +5,8 @@ from pysmartthings import Attribute, Capability
|
||||
|
||||
from homeassistant.components.binary_sensor import (
|
||||
DEVICE_CLASS_OPENING,
|
||||
DEVICE_CLASS_PRESENCE,
|
||||
DEVICE_CLASS_PROBLEM,
|
||||
DEVICE_CLASS_SOUND,
|
||||
BinarySensorEntity,
|
||||
)
|
||||
@@ -26,11 +28,11 @@ CAPABILITY_TO_ATTRIB = {
|
||||
ATTRIB_TO_CLASS = {
|
||||
Attribute.acceleration: "moving",
|
||||
Attribute.contact: DEVICE_CLASS_OPENING,
|
||||
Attribute.filter_status: "problem",
|
||||
Attribute.filter_status: DEVICE_CLASS_PROBLEM,
|
||||
Attribute.motion: "motion",
|
||||
Attribute.presence: "presence",
|
||||
Attribute.presence: DEVICE_CLASS_PRESENCE,
|
||||
Attribute.sound: DEVICE_CLASS_SOUND,
|
||||
Attribute.tamper: "problem",
|
||||
Attribute.tamper: DEVICE_CLASS_PROBLEM,
|
||||
Attribute.valve: DEVICE_CLASS_OPENING,
|
||||
Attribute.water: "moisture",
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user