Use problem, presence and plug device class constants in various integrations (#39973)
This commit is contained in:
1 parent
3d4ef8cfe1
commit
827711bcd1
5 files changed
+35
-13
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user