mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 10:59:40 +00:00
Use new DeviceClass and EntityCategory enums in august (#61288)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
@@ -19,15 +19,12 @@ from yalexs.util import update_lock_detail_from_activity
|
||||
|
||||
from homeassistant.components.august import AugustData
|
||||
from homeassistant.components.binary_sensor import (
|
||||
DEVICE_CLASS_CONNECTIVITY,
|
||||
DEVICE_CLASS_DOOR,
|
||||
DEVICE_CLASS_MOTION,
|
||||
DEVICE_CLASS_OCCUPANCY,
|
||||
BinarySensorDeviceClass,
|
||||
BinarySensorEntity,
|
||||
BinarySensorEntityDescription,
|
||||
)
|
||||
from homeassistant.const import ENTITY_CATEGORY_DIAGNOSTIC
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.helpers.entity import EntityCategory
|
||||
from homeassistant.helpers.event import async_call_later
|
||||
|
||||
from .const import ACTIVITY_UPDATE_INTERVAL, DATA_AUGUST, DOMAIN
|
||||
@@ -115,22 +112,22 @@ SENSOR_TYPES_DOORBELL: tuple[AugustBinarySensorEntityDescription, ...] = (
|
||||
AugustBinarySensorEntityDescription(
|
||||
key="doorbell_ding",
|
||||
name="Ding",
|
||||
device_class=DEVICE_CLASS_OCCUPANCY,
|
||||
device_class=BinarySensorDeviceClass.OCCUPANCY,
|
||||
value_fn=_retrieve_ding_state,
|
||||
is_time_based=True,
|
||||
),
|
||||
AugustBinarySensorEntityDescription(
|
||||
key="doorbell_motion",
|
||||
name="Motion",
|
||||
device_class=DEVICE_CLASS_MOTION,
|
||||
device_class=BinarySensorDeviceClass.MOTION,
|
||||
value_fn=_retrieve_motion_state,
|
||||
is_time_based=True,
|
||||
),
|
||||
AugustBinarySensorEntityDescription(
|
||||
key="doorbell_online",
|
||||
name="Online",
|
||||
device_class=DEVICE_CLASS_CONNECTIVITY,
|
||||
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
|
||||
device_class=BinarySensorDeviceClass.CONNECTIVITY,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
value_fn=_retrieve_online_state,
|
||||
is_time_based=False,
|
||||
),
|
||||
@@ -169,7 +166,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||
class AugustDoorBinarySensor(AugustEntityMixin, BinarySensorEntity):
|
||||
"""Representation of an August Door binary sensor."""
|
||||
|
||||
_attr_device_class = DEVICE_CLASS_DOOR
|
||||
_attr_device_class = BinarySensorDeviceClass.DOOR
|
||||
|
||||
def __init__(self, data, device, description: BinarySensorEntityDescription):
|
||||
"""Initialize the sensor."""
|
||||
|
||||
Reference in New Issue
Block a user