Move Intellifire error codes to individual sensors (#68249)
This commit is contained in:
parent
a5c729b724
commit
18517fda65
5 changed files with 84 additions and 9 deletions
|
@ -7,11 +7,13 @@ from dataclasses import dataclass
|
|||
from intellifire4py import IntellifirePollData
|
||||
|
||||
from homeassistant.components.binary_sensor import (
|
||||
BinarySensorDeviceClass,
|
||||
BinarySensorEntity,
|
||||
BinarySensorEntityDescription,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity import EntityCategory
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from . import IntellifireDataUpdateCoordinator
|
||||
|
@ -58,6 +60,85 @@ INTELLIFIRE_BINARY_SENSORS: tuple[IntellifireBinarySensorEntityDescription, ...]
|
|||
icon="mdi:home-thermometer-outline",
|
||||
value_fn=lambda data: data.thermostat_on,
|
||||
),
|
||||
IntellifireBinarySensorEntityDescription(
|
||||
key="error_pilot_flame",
|
||||
name="Pilot Flame Error",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
value_fn=lambda data: data.error_pilot_flame,
|
||||
device_class=BinarySensorDeviceClass.PROBLEM,
|
||||
),
|
||||
IntellifireBinarySensorEntityDescription(
|
||||
key="error_flame",
|
||||
name="Flame Error",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
value_fn=lambda data: data.error_flame,
|
||||
device_class=BinarySensorDeviceClass.PROBLEM,
|
||||
),
|
||||
IntellifireBinarySensorEntityDescription(
|
||||
key="error_fan_delay",
|
||||
name="Fan Delay Error",
|
||||
icon="mdi:fan-alert",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
value_fn=lambda data: data.error_fan_delay,
|
||||
device_class=BinarySensorDeviceClass.PROBLEM,
|
||||
),
|
||||
IntellifireBinarySensorEntityDescription(
|
||||
key="error_maintenance",
|
||||
name="Maintenance Error",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
value_fn=lambda data: data.error_maintenance,
|
||||
device_class=BinarySensorDeviceClass.PROBLEM,
|
||||
),
|
||||
IntellifireBinarySensorEntityDescription(
|
||||
key="error_disabled",
|
||||
name="Disabled Error",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
value_fn=lambda data: data.error_disabled,
|
||||
device_class=BinarySensorDeviceClass.PROBLEM,
|
||||
),
|
||||
IntellifireBinarySensorEntityDescription(
|
||||
key="error_fan",
|
||||
name="Fan Error",
|
||||
icon="mdi:fan-alert",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
value_fn=lambda data: data.error_fan,
|
||||
device_class=BinarySensorDeviceClass.PROBLEM,
|
||||
),
|
||||
IntellifireBinarySensorEntityDescription(
|
||||
key="error_lights",
|
||||
name="Lights Error",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
value_fn=lambda data: data.error_lights,
|
||||
device_class=BinarySensorDeviceClass.PROBLEM,
|
||||
),
|
||||
IntellifireBinarySensorEntityDescription(
|
||||
key="error_accessory",
|
||||
name="Accessory Error",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
value_fn=lambda data: data.error_accessory,
|
||||
device_class=BinarySensorDeviceClass.PROBLEM,
|
||||
),
|
||||
IntellifireBinarySensorEntityDescription(
|
||||
key="error_soft_lock_out",
|
||||
name="Soft Lock Out Error",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
value_fn=lambda data: data.error_soft_lock_out,
|
||||
device_class=BinarySensorDeviceClass.PROBLEM,
|
||||
),
|
||||
IntellifireBinarySensorEntityDescription(
|
||||
key="error_ecm_offline",
|
||||
name="ECM Offline Error",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
value_fn=lambda data: data.error_ecm_offline,
|
||||
device_class=BinarySensorDeviceClass.PROBLEM,
|
||||
),
|
||||
IntellifireBinarySensorEntityDescription(
|
||||
key="error_offline",
|
||||
name="Offline Error",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
value_fn=lambda data: data.error_offline,
|
||||
device_class=BinarySensorDeviceClass.PROBLEM,
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"name": "IntelliFire",
|
||||
"config_flow": true,
|
||||
"documentation": "https://www.home-assistant.io/integrations/intellifire",
|
||||
"requirements": ["intellifire4py==1.0.1"],
|
||||
"requirements": ["intellifire4py==1.0.2"],
|
||||
"codeowners": ["@jeeftor"],
|
||||
"iot_class": "local_polling",
|
||||
"loggers": ["intellifire4py"],
|
||||
|
|
|
@ -114,12 +114,6 @@ INTELLIFIRE_SENSORS: tuple[IntellifireSensorEntityDescription, ...] = (
|
|||
value_fn=lambda data: data.connection_quality,
|
||||
entity_registry_enabled_default=False,
|
||||
),
|
||||
IntellifireSensorEntityDescription(
|
||||
key="errors",
|
||||
name="Errors",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
value_fn=lambda data: data.error_codes_string,
|
||||
),
|
||||
IntellifireSensorEntityDescription(
|
||||
key="ecm_latency",
|
||||
name="ECM Latency",
|
||||
|
|
|
@ -875,7 +875,7 @@ influxdb-client==1.24.0
|
|||
influxdb==5.3.1
|
||||
|
||||
# homeassistant.components.intellifire
|
||||
intellifire4py==1.0.1
|
||||
intellifire4py==1.0.2
|
||||
|
||||
# homeassistant.components.iotawatt
|
||||
iotawattpy==0.1.0
|
||||
|
|
|
@ -607,7 +607,7 @@ influxdb-client==1.24.0
|
|||
influxdb==5.3.1
|
||||
|
||||
# homeassistant.components.intellifire
|
||||
intellifire4py==1.0.1
|
||||
intellifire4py==1.0.2
|
||||
|
||||
# homeassistant.components.iotawatt
|
||||
iotawattpy==0.1.0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue