Skip to content

Commit

Permalink
Add icon translations to Daikin (home-assistant#111362)
Browse files Browse the repository at this point in the history
  • Loading branch information
joostlek authored Feb 25, 2024
1 parent 18fcb14 commit 5fa4be0
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 9 deletions.
26 changes: 26 additions & 0 deletions homeassistant/components/daikin/icons.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"entity": {
"sensor": {
"cool_energy_consumption": {
"default": "mdi:snowflake"
},
"heat_energy_consumption": {
"default": "mdi:fire"
},
"compressor_frequency": {
"default": "mdi:fan"
}
},
"switch": {
"zone": {
"default": "mdi:home-circle"
},
"streamer": {
"default": "mdi:air-filter"
},
"toggle": {
"default": "mdi:power"
}
}
}
}
3 changes: 0 additions & 3 deletions homeassistant/components/daikin/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ class DaikinSensorEntityDescription(SensorEntityDescription, DaikinRequiredKeysM
DaikinSensorEntityDescription(
key=ATTR_COOL_ENERGY,
translation_key="cool_energy_consumption",
icon="mdi:snowflake",
device_class=SensorDeviceClass.ENERGY,
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
entity_registry_enabled_default=False,
Expand All @@ -103,7 +102,6 @@ class DaikinSensorEntityDescription(SensorEntityDescription, DaikinRequiredKeysM
DaikinSensorEntityDescription(
key=ATTR_HEAT_ENERGY,
translation_key="heat_energy_consumption",
icon="mdi:fire",
device_class=SensorDeviceClass.ENERGY,
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
entity_registry_enabled_default=False,
Expand All @@ -120,7 +118,6 @@ class DaikinSensorEntityDescription(SensorEntityDescription, DaikinRequiredKeysM
DaikinSensorEntityDescription(
key=ATTR_COMPRESSOR_FREQUENCY,
translation_key="compressor_frequency",
icon="mdi:fan",
device_class=SensorDeviceClass.FREQUENCY,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfFrequency.HERTZ,
Expand Down
9 changes: 3 additions & 6 deletions homeassistant/components/daikin/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@

from . import DOMAIN as DAIKIN_DOMAIN, DaikinApi

ZONE_ICON = "mdi:home-circle"
STREAMER_ICON = "mdi:air-filter"
TOGGLE_ICON = "mdi:power"
DAIKIN_ATTR_ADVANCED = "adv"
DAIKIN_ATTR_STREAMER = "streamer"
DAIKIN_ATTR_MODE = "mode"
Expand Down Expand Up @@ -58,8 +55,8 @@ async def async_setup_entry(
class DaikinZoneSwitch(SwitchEntity):
"""Representation of a zone."""

_attr_icon = ZONE_ICON
_attr_has_entity_name = True
_attr_translation_key = "zone"

def __init__(self, api: DaikinApi, zone_id: int) -> None:
"""Initialize the zone."""
Expand Down Expand Up @@ -94,9 +91,9 @@ async def async_turn_off(self, **kwargs: Any) -> None:
class DaikinStreamerSwitch(SwitchEntity):
"""Streamer state."""

_attr_icon = STREAMER_ICON
_attr_name = "Streamer"
_attr_has_entity_name = True
_attr_translation_key = "streamer"

def __init__(self, api: DaikinApi) -> None:
"""Initialize streamer switch."""
Expand Down Expand Up @@ -127,8 +124,8 @@ async def async_turn_off(self, **kwargs: Any) -> None:
class DaikinToggleSwitch(SwitchEntity):
"""Switch state."""

_attr_icon = TOGGLE_ICON
_attr_has_entity_name = True
_attr_translation_key = "toggle"

def __init__(self, api: DaikinApi) -> None:
"""Initialize switch."""
Expand Down

0 comments on commit 5fa4be0

Please sign in to comment.