Use new enums in smappee (#62209)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2021-12-18 14:56:13 +01:00 committed by GitHub
parent af631b90e5
commit 93cba53860
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 42 additions and 45 deletions

View file

@ -1,6 +1,6 @@
"""Support for monitoring a Smappee appliance binary sensor."""
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_PRESENCE,
BinarySensorDeviceClass,
BinarySensorEntity,
)
from homeassistant.helpers.entity import DeviceInfo
@ -58,7 +58,7 @@ class SmappeePresence(BinarySensorEntity):
@property
def device_class(self):
"""Return the class of this device, from component DEVICE_CLASSES."""
return DEVICE_CLASS_PRESENCE
return BinarySensorDeviceClass.PRESENCE
@property
def unique_id(
@ -68,7 +68,7 @@ class SmappeePresence(BinarySensorEntity):
return (
f"{self._service_location.device_serial_number}-"
f"{self._service_location.service_location_id}-"
f"{DEVICE_CLASS_PRESENCE}"
f"{BinarySensorDeviceClass.PRESENCE}"
)
@property