Use opening and occupancy device class in various integrations (#39965)

This commit is contained in:
springstan 2020-09-12 18:07:13 +02:00 committed by GitHub
parent 4c0f075d6a
commit cee96ae207
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 62 additions and 25 deletions

View file

@ -4,6 +4,7 @@ from typing import Optional, Sequence
from pysmartthings import Attribute, Capability
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_OPENING,
DEVICE_CLASS_SOUND,
BinarySensorEntity,
)
@ -24,13 +25,13 @@ CAPABILITY_TO_ATTRIB = {
}
ATTRIB_TO_CLASS = {
Attribute.acceleration: "moving",
Attribute.contact: "opening",
Attribute.contact: DEVICE_CLASS_OPENING,
Attribute.filter_status: "problem",
Attribute.motion: "motion",
Attribute.presence: "presence",
Attribute.sound: DEVICE_CLASS_SOUND,
Attribute.tamper: "problem",
Attribute.valve: "opening",
Attribute.valve: DEVICE_CLASS_OPENING,
Attribute.water: "moisture",
}