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
@@ -2,7 +2,10 @@
|
||||
|
||||
import logging
|
||||
|
||||
from homeassistant.components.binary_sensor import BinarySensorEntity
|
||||
from homeassistant.components.binary_sensor import (
|
||||
DEVICE_CLASS_PROBLEM,
|
||||
BinarySensorEntity,
|
||||
)
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
|
||||
@@ -83,7 +86,9 @@ class AlarmSensor(SmartyBinarySensor):
|
||||
|
||||
def __init__(self, name, smarty):
|
||||
"""Alarm Sensor Init."""
|
||||
super().__init__(name=f"{name} Alarm", device_class="problem", smarty=smarty)
|
||||
super().__init__(
|
||||
name=f"{name} Alarm", device_class=DEVICE_CLASS_PROBLEM, smarty=smarty
|
||||
)
|
||||
|
||||
def update(self) -> None:
|
||||
"""Update state."""
|
||||
@@ -96,7 +101,9 @@ class WarningSensor(SmartyBinarySensor):
|
||||
|
||||
def __init__(self, name, smarty):
|
||||
"""Warning Sensor Init."""
|
||||
super().__init__(name=f"{name} Warning", device_class="problem", smarty=smarty)
|
||||
super().__init__(
|
||||
name=f"{name} Warning", device_class=DEVICE_CLASS_PROBLEM, smarty=smarty
|
||||
)
|
||||
|
||||
def update(self) -> None:
|
||||
"""Update state."""
|
||||
|
||||
Reference in new issue
Block a user