Skip to content

Commit

Permalink
feat: Add icons to some entities
Browse files Browse the repository at this point in the history
  • Loading branch information
alepee committed Nov 18, 2024
1 parent 2025c3d commit f75283c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
8 changes: 8 additions & 0 deletions custom_components/hitachi_yutaki/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class HitachiYutakiBinarySensorEntityDescription(BinarySensorEntityDescription):
HitachiYutakiBinarySensorEntityDescription(
key="defrost",
name="Defrost",
icon="mdi:snowflake",
description="Indicates if the unit is currently in defrost mode",
device_class=BinarySensorDeviceClass.RUNNING,
entity_category=EntityCategory.DIAGNOSTIC,
Expand All @@ -68,6 +69,7 @@ class HitachiYutakiBinarySensorEntityDescription(BinarySensorEntityDescription):
HitachiYutakiBinarySensorEntityDescription(
key="solar",
name="Solar",
icon="mdi:solar-power",
description="Indicates if the solar system is active",
device_class=BinarySensorDeviceClass.RUNNING,
entity_category=EntityCategory.DIAGNOSTIC,
Expand All @@ -77,6 +79,7 @@ class HitachiYutakiBinarySensorEntityDescription(BinarySensorEntityDescription):
HitachiYutakiBinarySensorEntityDescription(
key="pump1",
name="Pump 1",
icon="mdi:pump",
description="Indicates if water pump 1 is running",
device_class=BinarySensorDeviceClass.RUNNING,
entity_category=EntityCategory.DIAGNOSTIC,
Expand All @@ -86,6 +89,7 @@ class HitachiYutakiBinarySensorEntityDescription(BinarySensorEntityDescription):
HitachiYutakiBinarySensorEntityDescription(
key="pump2",
name="Pump 2",
icon="mdi:pump",
description="Indicates if water pump 2 is running",
device_class=BinarySensorDeviceClass.RUNNING,
entity_category=EntityCategory.DIAGNOSTIC,
Expand All @@ -95,6 +99,7 @@ class HitachiYutakiBinarySensorEntityDescription(BinarySensorEntityDescription):
HitachiYutakiBinarySensorEntityDescription(
key="pump3",
name="Pump 3",
icon="mdi:pump",
description="Indicates if water pump 3 is running",
device_class=BinarySensorDeviceClass.RUNNING,
entity_category=EntityCategory.DIAGNOSTIC,
Expand All @@ -104,6 +109,7 @@ class HitachiYutakiBinarySensorEntityDescription(BinarySensorEntityDescription):
HitachiYutakiBinarySensorEntityDescription(
key="compressor",
name="Compressor",
icon="mdi:heat-pump",
description="Indicates if the compressor is running",
device_class=BinarySensorDeviceClass.RUNNING,
entity_category=EntityCategory.DIAGNOSTIC,
Expand All @@ -113,6 +119,7 @@ class HitachiYutakiBinarySensorEntityDescription(BinarySensorEntityDescription):
HitachiYutakiBinarySensorEntityDescription(
key="boiler",
name="Boiler",
icon="mdi:boiler",
description="Indicates if the backup boiler is active",
device_class=BinarySensorDeviceClass.RUNNING,
entity_category=EntityCategory.DIAGNOSTIC,
Expand All @@ -122,6 +129,7 @@ class HitachiYutakiBinarySensorEntityDescription(BinarySensorEntityDescription):
HitachiYutakiBinarySensorEntityDescription(
key="dhw_heater",
name="DHW Heater",
icon="mdi:boiler",
description="Indicates if the DHW electric heater is active",
device_class=BinarySensorDeviceClass.RUNNING,
entity_category=EntityCategory.DIAGNOSTIC,
Expand Down
9 changes: 6 additions & 3 deletions custom_components/hitachi_yutaki/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class HitachiYutakiSwitchEntityDescription(SwitchEntityDescription):
HitachiYutakiSwitchEntityDescription(
key="power",
name="Power",
icon="mdi:power",
description="Main power switch for the heat pump unit",
register_key="unit_power",
),
Expand All @@ -54,6 +55,7 @@ class HitachiYutakiSwitchEntityDescription(SwitchEntityDescription):
HitachiYutakiSwitchEntityDescription(
key="power",
name="Power",
icon="mdi:power",
description="Power switch for this heating/cooling circuit",
register_key="power",
),
Expand All @@ -67,26 +69,27 @@ class HitachiYutakiSwitchEntityDescription(SwitchEntityDescription):
HitachiYutakiSwitchEntityDescription(
key="eco_mode",
name="ECO Mode",
icon="mdi:leaf",
description="Enable/disable ECO mode which applies a temperature offset to save energy",
register_key="eco_mode",
state_on=0,
state_off=1,
icon="mdi:leaf",
),
)

DHW_SWITCHES: Final[tuple[HitachiYutakiSwitchEntityDescription, ...]] = (
HitachiYutakiSwitchEntityDescription(
key="power",
name="Power",
icon="mdi:power",
description="Power switch for domestic hot water production",
register_key="power",
),
HitachiYutakiSwitchEntityDescription(
key="boost",
name="Boost",
description="Temporarily boost DHW production",
register_key="boost",
register_key="dhw_boost",
),
HitachiYutakiSwitchEntityDescription(
key="high_demand",
Expand All @@ -98,7 +101,7 @@ class HitachiYutakiSwitchEntityDescription(SwitchEntityDescription):
HitachiYutakiSwitchEntityDescription(
key="antilegionella",
name="Anti-legionella",
description="Enable/disable periodic high temperature treatment to prevent legionella",
description="Enable/disable periodic high temperature treatment to prevent legionella. This parameter can only be used if the function is enabled on the LCD.",
register_key="antilegionella_power",
entity_category=EntityCategory.CONFIG,
),
Expand Down

0 comments on commit f75283c

Please sign in to comment.