Add new Binary Sensor description to Overkiz integration (#64322)

This commit is contained in:
Mick Vleeshouwer 2022-01-17 12:46:20 -08:00 committed by GitHub
parent f0fdd7d650
commit 8f6884ac10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,7 @@ from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from typing import cast
from pyoverkiz.enums import OverkizCommandParam, OverkizState
from pyoverkiz.types import StateType as OverkizStateType
@ -100,6 +101,16 @@ BINARY_SENSOR_DESCRIPTIONS: list[OverkizBinarySensorDescription] = [
device_class=BinarySensorDeviceClass.VIBRATION,
value_fn=lambda state: state == OverkizCommandParam.DETECTED,
),
# DomesticHotWaterProduction/WaterHeatingSystem
OverkizBinarySensorDescription(
key=OverkizState.IO_OPERATING_MODE_CAPABILITIES,
name="Energy Demand Status",
device_class=BinarySensorDeviceClass.HEAT,
value_fn=lambda state: cast(dict, state).get(
OverkizCommandParam.ENERGY_DEMAND_STATUS
)
== 1,
),
]
SUPPORTED_STATES = {