Use enums in screenlogic (#62049)
This commit is contained in:
parent
21e46e318d
commit
31bef18e9a
2 changed files with 5 additions and 9 deletions
homeassistant/components/screenlogic
|
@ -2,14 +2,14 @@
|
||||||
from screenlogicpy.const import DATA as SL_DATA, DEVICE_TYPE, EQUIPMENT, ON_OFF
|
from screenlogicpy.const import DATA as SL_DATA, DEVICE_TYPE, EQUIPMENT, ON_OFF
|
||||||
|
|
||||||
from homeassistant.components.binary_sensor import (
|
from homeassistant.components.binary_sensor import (
|
||||||
DEVICE_CLASS_PROBLEM,
|
BinarySensorDeviceClass,
|
||||||
BinarySensorEntity,
|
BinarySensorEntity,
|
||||||
)
|
)
|
||||||
|
|
||||||
from . import ScreenlogicEntity
|
from . import ScreenlogicEntity
|
||||||
from .const import DOMAIN
|
from .const import DOMAIN
|
||||||
|
|
||||||
SL_DEVICE_TYPE_TO_HA_DEVICE_CLASS = {DEVICE_TYPE.ALARM: DEVICE_CLASS_PROBLEM}
|
SL_DEVICE_TYPE_TO_HA_DEVICE_CLASS = {DEVICE_TYPE.ALARM: BinarySensorDeviceClass.PROBLEM}
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(hass, config_entry, async_add_entities):
|
async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||||
|
|
|
@ -6,11 +6,7 @@ from screenlogicpy.const import (
|
||||||
EQUIPMENT,
|
EQUIPMENT,
|
||||||
)
|
)
|
||||||
|
|
||||||
from homeassistant.components.sensor import (
|
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
|
||||||
DEVICE_CLASS_POWER,
|
|
||||||
DEVICE_CLASS_TEMPERATURE,
|
|
||||||
SensorEntity,
|
|
||||||
)
|
|
||||||
|
|
||||||
from . import ScreenlogicEntity
|
from . import ScreenlogicEntity
|
||||||
from .const import DOMAIN
|
from .const import DOMAIN
|
||||||
|
@ -41,8 +37,8 @@ SUPPORTED_SCG_SENSORS = (
|
||||||
SUPPORTED_PUMP_SENSORS = ("currentWatts", "currentRPM", "currentGPM")
|
SUPPORTED_PUMP_SENSORS = ("currentWatts", "currentRPM", "currentGPM")
|
||||||
|
|
||||||
SL_DEVICE_TYPE_TO_HA_DEVICE_CLASS = {
|
SL_DEVICE_TYPE_TO_HA_DEVICE_CLASS = {
|
||||||
DEVICE_TYPE.TEMPERATURE: DEVICE_CLASS_TEMPERATURE,
|
DEVICE_TYPE.TEMPERATURE: SensorDeviceClass.TEMPERATURE,
|
||||||
DEVICE_TYPE.ENERGY: DEVICE_CLASS_POWER,
|
DEVICE_TYPE.ENERGY: SensorDeviceClass.POWER,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue