Use problem, presence and plug device class constants in various integrations (#39973)
This commit is contained in:
parent
3d4ef8cfe1
commit
827711bcd1
5 changed files with 35 additions and 13 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue