mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Use new BinarySensorDeviceClass in insteon (#61801)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
d254d963b8
commit
ef2a28cce2
@ -14,17 +14,8 @@ from pyinsteon.groups import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
from homeassistant.components.binary_sensor import (
|
from homeassistant.components.binary_sensor import (
|
||||||
DEVICE_CLASS_BATTERY,
|
|
||||||
DEVICE_CLASS_DOOR,
|
|
||||||
DEVICE_CLASS_GAS,
|
|
||||||
DEVICE_CLASS_LIGHT,
|
|
||||||
DEVICE_CLASS_MOISTURE,
|
|
||||||
DEVICE_CLASS_MOTION,
|
|
||||||
DEVICE_CLASS_OPENING,
|
|
||||||
DEVICE_CLASS_PROBLEM,
|
|
||||||
DEVICE_CLASS_SAFETY,
|
|
||||||
DEVICE_CLASS_SMOKE,
|
|
||||||
DOMAIN as BINARY_SENSOR_DOMAIN,
|
DOMAIN as BINARY_SENSOR_DOMAIN,
|
||||||
|
BinarySensorDeviceClass,
|
||||||
BinarySensorEntity,
|
BinarySensorEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.core import callback
|
from homeassistant.core import callback
|
||||||
@ -35,17 +26,17 @@ from .insteon_entity import InsteonEntity
|
|||||||
from .utils import async_add_insteon_entities
|
from .utils import async_add_insteon_entities
|
||||||
|
|
||||||
SENSOR_TYPES = {
|
SENSOR_TYPES = {
|
||||||
OPEN_CLOSE_SENSOR: DEVICE_CLASS_OPENING,
|
OPEN_CLOSE_SENSOR: BinarySensorDeviceClass.OPENING,
|
||||||
MOTION_SENSOR: DEVICE_CLASS_MOTION,
|
MOTION_SENSOR: BinarySensorDeviceClass.MOTION,
|
||||||
DOOR_SENSOR: DEVICE_CLASS_DOOR,
|
DOOR_SENSOR: BinarySensorDeviceClass.DOOR,
|
||||||
LEAK_SENSOR_WET: DEVICE_CLASS_MOISTURE,
|
LEAK_SENSOR_WET: BinarySensorDeviceClass.MOISTURE,
|
||||||
LIGHT_SENSOR: DEVICE_CLASS_LIGHT,
|
LIGHT_SENSOR: BinarySensorDeviceClass.LIGHT,
|
||||||
LOW_BATTERY: DEVICE_CLASS_BATTERY,
|
LOW_BATTERY: BinarySensorDeviceClass.BATTERY,
|
||||||
CO_SENSOR: DEVICE_CLASS_GAS,
|
CO_SENSOR: BinarySensorDeviceClass.GAS,
|
||||||
SMOKE_SENSOR: DEVICE_CLASS_SMOKE,
|
SMOKE_SENSOR: BinarySensorDeviceClass.SMOKE,
|
||||||
TEST_SENSOR: DEVICE_CLASS_SAFETY,
|
TEST_SENSOR: BinarySensorDeviceClass.SAFETY,
|
||||||
SENSOR_MALFUNCTION: DEVICE_CLASS_PROBLEM,
|
SENSOR_MALFUNCTION: BinarySensorDeviceClass.PROBLEM,
|
||||||
HEARTBEAT: DEVICE_CLASS_PROBLEM,
|
HEARTBEAT: BinarySensorDeviceClass.PROBLEM,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user