Use enums in skybell (#62053)

This commit is contained in:
Robert Hillis 2021-12-16 08:19:23 -05:00 committed by GitHub
parent 1dab28a957
commit 25f72e45d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,9 +7,8 @@ from typing import Any
import voluptuous as vol import voluptuous as vol
from homeassistant.components.binary_sensor import ( from homeassistant.components.binary_sensor import (
DEVICE_CLASS_MOTION,
DEVICE_CLASS_OCCUPANCY,
PLATFORM_SCHEMA, PLATFORM_SCHEMA,
BinarySensorDeviceClass,
BinarySensorEntity, BinarySensorEntity,
BinarySensorEntityDescription, BinarySensorEntityDescription,
) )
@ -25,12 +24,12 @@ BINARY_SENSOR_TYPES: dict[str, BinarySensorEntityDescription] = {
"button": BinarySensorEntityDescription( "button": BinarySensorEntityDescription(
key="device:sensor:button", key="device:sensor:button",
name="Button", name="Button",
device_class=DEVICE_CLASS_OCCUPANCY, device_class=BinarySensorDeviceClass.OCCUPANCY,
), ),
"motion": BinarySensorEntityDescription( "motion": BinarySensorEntityDescription(
key="device:sensor:motion", key="device:sensor:motion",
name="Motion", name="Motion",
device_class=DEVICE_CLASS_MOTION, device_class=BinarySensorDeviceClass.MOTION,
), ),
} }