Use problem, presence and plug device class constants in various integrations (#39973)

This commit is contained in:
springstan 2020-09-12 20:23:24 +02:00 committed by GitHub
parent 3d4ef8cfe1
commit 827711bcd1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 35 additions and 13 deletions

View file

@ -1,7 +1,10 @@
"""Support for monitoring a Smappee appliance binary sensor."""
import logging
from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_PRESENCE,
BinarySensorEntity,
)
from .const import DOMAIN
@ -58,7 +61,7 @@ class SmappeePresence(BinarySensorEntity):
@property
def device_class(self):
"""Return the class of this device, from component DEVICE_CLASSES."""
return "presence"
return DEVICE_CLASS_PRESENCE
@property
def unique_id(
@ -68,7 +71,7 @@ class SmappeePresence(BinarySensorEntity):
return (
f"{self._service_location.device_serial_number}-"
f"{self._service_location.service_location_id}-"
f"presence"
f"{DEVICE_CLASS_PRESENCE}"
)
@property