Use DEVICE_CLASS_MOTION in various integrations (#39962)

This commit is contained in:
springstan 2020-09-12 23:20:30 +02:00 committed by GitHub
parent 02cb592917
commit e55035b2f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 59 additions and 31 deletions

View file

@ -4,6 +4,7 @@ import logging
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_CONNECTIVITY,
DEVICE_CLASS_MOTION,
DEVICE_CLASS_OCCUPANCY,
DEVICE_CLASS_SOUND,
BinarySensorEntity,
@ -24,7 +25,7 @@ CLIMATE_BINARY_TYPES = {
}
CAMERA_BINARY_TYPES = {
"motion_detected": "motion",
"motion_detected": DEVICE_CLASS_MOTION,
"sound_detected": DEVICE_CLASS_SOUND,
"person_detected": DEVICE_CLASS_OCCUPANCY,
}
@ -158,7 +159,7 @@ class NestActivityZoneSensor(NestBinarySensor):
@property
def device_class(self):
"""Return the device class of the binary sensor."""
return "motion"
return DEVICE_CLASS_MOTION
def update(self):
"""Retrieve latest state."""