Use sound, vibration and safety device class constants in various integrations (#39952)
* Use sound, vibration and safety device class constants in various integrations * Fix wrong imports
This commit is contained in:
1 parent
ee5c1ea3f7
commit
ac2e290d97
7 files changed
+36
-19
No files matched your search
@@ -3,7 +3,11 @@ import logging
|
||||
|
||||
import pywink
|
||||
|
||||
from homeassistant.components.binary_sensor import BinarySensorEntity
|
||||
from homeassistant.components.binary_sensor import (
|
||||
DEVICE_CLASS_SOUND,
|
||||
DEVICE_CLASS_VIBRATION,
|
||||
BinarySensorEntity,
|
||||
)
|
||||
|
||||
from . import DOMAIN, WinkDevice
|
||||
|
||||
@@ -12,17 +16,17 @@ _LOGGER = logging.getLogger(__name__)
|
||||
# These are the available sensors mapped to binary_sensor class
|
||||
SENSOR_TYPES = {
|
||||
"brightness": "light",
|
||||
"capturing_audio": "sound",
|
||||
"capturing_audio": DEVICE_CLASS_SOUND,
|
||||
"capturing_video": None,
|
||||
"co_detected": "gas",
|
||||
"liquid_detected": "moisture",
|
||||
"loudness": "sound",
|
||||
"loudness": DEVICE_CLASS_SOUND,
|
||||
"motion": "motion",
|
||||
"noise": "sound",
|
||||
"noise": DEVICE_CLASS_SOUND,
|
||||
"opened": "opening",
|
||||
"presence": "occupancy",
|
||||
"smoke_detected": "smoke",
|
||||
"vibration": "vibration",
|
||||
"vibration": DEVICE_CLASS_VIBRATION,
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user