mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Use enums in rachio (#62056)
This commit is contained in:
parent
16e152b797
commit
da60680b2f
@ -3,8 +3,7 @@ from abc import abstractmethod
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.components.binary_sensor import (
|
from homeassistant.components.binary_sensor import (
|
||||||
DEVICE_CLASS_CONNECTIVITY,
|
BinarySensorDeviceClass,
|
||||||
DEVICE_CLASS_MOISTURE,
|
|
||||||
BinarySensorEntity,
|
BinarySensorEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.core import callback
|
from homeassistant.core import callback
|
||||||
@ -89,9 +88,9 @@ class RachioControllerOnlineBinarySensor(RachioControllerBinarySensor):
|
|||||||
return f"{self._controller.controller_id}-online"
|
return f"{self._controller.controller_id}-online"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_class(self) -> str:
|
def device_class(self) -> BinarySensorDeviceClass:
|
||||||
"""Return the class of this device, from component DEVICE_CLASSES."""
|
"""Return the class of this device, from BinarySensorDeviceClass."""
|
||||||
return DEVICE_CLASS_CONNECTIVITY
|
return BinarySensorDeviceClass.CONNECTIVITY
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def icon(self) -> str:
|
def icon(self) -> str:
|
||||||
@ -138,9 +137,9 @@ class RachioRainSensor(RachioControllerBinarySensor):
|
|||||||
return f"{self._controller.controller_id}-rain_sensor"
|
return f"{self._controller.controller_id}-rain_sensor"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_class(self) -> str:
|
def device_class(self) -> BinarySensorDeviceClass:
|
||||||
"""Return the class of this device."""
|
"""Return the class of this device."""
|
||||||
return DEVICE_CLASS_MOISTURE
|
return BinarySensorDeviceClass.MOISTURE
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def icon(self) -> str:
|
def icon(self) -> str:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user