Skip to content

Commit

Permalink
Add support event sensors for include
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Jan 15, 2024
1 parent 2ddb940 commit 335a4c6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion custom_components/yandex_station/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
_LOGGER = logging.getLogger(__name__)

INCLUDE_TYPES = ["devices.types.sensor"]
INCLUDE_PROPERTIES = ["devices.properties.float"]
INCLUDE_PROPERTIES = ["devices.properties.float", "devices.properties.event"]

SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
SensorEntityDescription(
Expand Down Expand Up @@ -82,6 +82,15 @@
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
state_class=SensorStateClass.MEASUREMENT,
),
SensorEntityDescription(key="vibration", device_class=SensorDeviceClass.ENUM),
SensorEntityDescription(key="open", device_class=SensorDeviceClass.ENUM),
SensorEntityDescription(key="button", device_class=SensorDeviceClass.ENUM),
SensorEntityDescription(key="motion", device_class=SensorDeviceClass.ENUM),
SensorEntityDescription(key="smoke", device_class=SensorDeviceClass.ENUM),
SensorEntityDescription(key="gas", device_class=SensorDeviceClass.ENUM),
SensorEntityDescription(key="food_level", device_class=SensorDeviceClass.ENUM),
SensorEntityDescription(key="water_level", device_class=SensorDeviceClass.ENUM),
SensorEntityDescription(key="water_leak", device_class=SensorDeviceClass.ENUM),
)

INCLUDE_INSTANCES: list[str] = [desc.key for desc in SENSOR_TYPES]
Expand Down

0 comments on commit 335a4c6

Please sign in to comment.