mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Use icon translations for enphase_envoy. (#136190)
This commit is contained in:
parent
b8632063f5
commit
03be8a039c
@ -67,7 +67,6 @@ ENPOWER_SENSORS = (
|
||||
EnvoyEnpowerBinarySensorEntityDescription(
|
||||
key="mains_oper_state",
|
||||
translation_key="grid_status",
|
||||
icon="mdi:transmission-tower",
|
||||
value_fn=lambda enpower: enpower.mains_oper_state == "closed",
|
||||
),
|
||||
)
|
||||
|
58
homeassistant/components/enphase_envoy/icons.json
Normal file
58
homeassistant/components/enphase_envoy/icons.json
Normal file
@ -0,0 +1,58 @@
|
||||
{
|
||||
"entity": {
|
||||
"binary_sensor": {
|
||||
"grid_status": {
|
||||
"default": "mdi:transmission-tower",
|
||||
"state": {
|
||||
"off": "mdi:transmission-tower-off"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sensor": {
|
||||
"current_power_production": {
|
||||
"default": "mdi:solar-power"
|
||||
},
|
||||
"daily_production": {
|
||||
"default": "mdi:solar-power"
|
||||
},
|
||||
"seven_days_production": {
|
||||
"default": "mdi:solar-power"
|
||||
},
|
||||
"lifetime_production": {
|
||||
"default": "mdi:solar-power"
|
||||
},
|
||||
"current_power_production_phase": {
|
||||
"default": "mdi:solar-power"
|
||||
},
|
||||
"daily_production_phase": {
|
||||
"default": "mdi:solar-power"
|
||||
},
|
||||
"seven_days_production_phase": {
|
||||
"default": "mdi:solar-power"
|
||||
},
|
||||
"lifetime_production_phase": {
|
||||
"default": "mdi:solar-power"
|
||||
},
|
||||
"max_capacity": {
|
||||
"default": "mdi:battery-charging-100"
|
||||
},
|
||||
"available_energy": {
|
||||
"default": "mdi:battery-50"
|
||||
}
|
||||
},
|
||||
"switch": {
|
||||
"grid_enabled": {
|
||||
"default": "mdi:transmission-tower",
|
||||
"state": {
|
||||
"off": "mdi:transmission-tower-off"
|
||||
}
|
||||
},
|
||||
"relay_status": {
|
||||
"default": "mdi:electric-switch-closed",
|
||||
"state": {
|
||||
"off": "mdi:electric-switch"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -81,7 +81,7 @@ rules:
|
||||
entity-disabled-by-default: done
|
||||
entity-translations: done
|
||||
exception-translations: done
|
||||
icon-translations: todo
|
||||
icon-translations: done
|
||||
reconfiguration-flow: done
|
||||
repair-issues:
|
||||
status: exempt
|
||||
|
@ -55,7 +55,6 @@ from .const import DOMAIN
|
||||
from .coordinator import EnphaseConfigEntry, EnphaseUpdateCoordinator
|
||||
from .entity import EnvoyBaseEntity
|
||||
|
||||
ICON = "mdi:flash"
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
INVERTERS_KEY = "inverters"
|
||||
@ -946,8 +945,6 @@ class EnvoySensorBaseEntity(EnvoyBaseEntity, SensorEntity):
|
||||
class EnvoySystemSensorEntity(EnvoySensorBaseEntity):
|
||||
"""Envoy system base entity."""
|
||||
|
||||
_attr_icon = ICON
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
coordinator: EnphaseUpdateCoordinator,
|
||||
@ -1174,7 +1171,6 @@ class EnvoyStorageCTPhaseEntity(EnvoySystemSensorEntity):
|
||||
class EnvoyInverterEntity(EnvoySensorBaseEntity):
|
||||
"""Envoy inverter entity."""
|
||||
|
||||
_attr_icon = ICON
|
||||
entity_description: EnvoyInverterSensorEntityDescription
|
||||
|
||||
def __init__(
|
||||
|
@ -60,6 +60,7 @@ ENPOWER_GRID_SWITCH = EnvoyEnpowerSwitchEntityDescription(
|
||||
|
||||
RELAY_STATE_SWITCH = EnvoyDryContactSwitchEntityDescription(
|
||||
key="relay_status",
|
||||
translation_key="relay_status",
|
||||
value_fn=lambda dry_contact: dry_contact.status == DryContactStatus.CLOSED,
|
||||
turn_on_fn=lambda envoy, id: envoy.close_dry_contact(id),
|
||||
turn_off_fn=lambda envoy, id: envoy.open_dry_contact(id),
|
||||
|
@ -255,7 +255,7 @@
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': 'mdi:transmission-tower',
|
||||
'original_icon': None,
|
||||
'original_name': 'Grid status',
|
||||
'platform': 'enphase_envoy',
|
||||
'previous_unique_id': None,
|
||||
@ -269,7 +269,6 @@
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Enpower 654321 Grid status',
|
||||
'icon': 'mdi:transmission-tower',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'binary_sensor.enpower_654321_grid_status',
|
||||
|
@ -88,7 +88,7 @@
|
||||
}),
|
||||
}),
|
||||
'original_device_class': 'power',
|
||||
'original_icon': 'mdi:flash',
|
||||
'original_icon': None,
|
||||
'original_name': 'Current power production',
|
||||
'platform': 'enphase_envoy',
|
||||
'previous_unique_id': None,
|
||||
@ -101,7 +101,6 @@
|
||||
'attributes': dict({
|
||||
'device_class': 'power',
|
||||
'friendly_name': 'Envoy <<envoyserial>> Current power production',
|
||||
'icon': 'mdi:flash',
|
||||
'state_class': 'measurement',
|
||||
'unit_of_measurement': 'kW',
|
||||
}),
|
||||
@ -140,7 +139,7 @@
|
||||
}),
|
||||
}),
|
||||
'original_device_class': 'energy',
|
||||
'original_icon': 'mdi:flash',
|
||||
'original_icon': None,
|
||||
'original_name': 'Energy production today',
|
||||
'platform': 'enphase_envoy',
|
||||
'previous_unique_id': None,
|
||||
@ -153,7 +152,6 @@
|
||||
'attributes': dict({
|
||||
'device_class': 'energy',
|
||||
'friendly_name': 'Envoy <<envoyserial>> Energy production today',
|
||||
'icon': 'mdi:flash',
|
||||
'state_class': 'total_increasing',
|
||||
'unit_of_measurement': 'kWh',
|
||||
}),
|
||||
@ -190,7 +188,7 @@
|
||||
}),
|
||||
}),
|
||||
'original_device_class': 'energy',
|
||||
'original_icon': 'mdi:flash',
|
||||
'original_icon': None,
|
||||
'original_name': 'Energy production last seven days',
|
||||
'platform': 'enphase_envoy',
|
||||
'previous_unique_id': None,
|
||||
@ -203,7 +201,6 @@
|
||||
'attributes': dict({
|
||||
'device_class': 'energy',
|
||||
'friendly_name': 'Envoy <<envoyserial>> Energy production last seven days',
|
||||
'icon': 'mdi:flash',
|
||||
'unit_of_measurement': 'kWh',
|
||||
}),
|
||||
'entity_id': 'sensor.envoy_<<envoyserial>>_energy_production_last_seven_days',
|
||||
@ -241,7 +238,7 @@
|
||||
}),
|
||||
}),
|
||||
'original_device_class': 'energy',
|
||||
'original_icon': 'mdi:flash',
|
||||
'original_icon': None,
|
||||
'original_name': 'Lifetime energy production',
|
||||
'platform': 'enphase_envoy',
|
||||
'previous_unique_id': None,
|
||||
@ -254,7 +251,6 @@
|
||||
'attributes': dict({
|
||||
'device_class': 'energy',
|
||||
'friendly_name': 'Envoy <<envoyserial>> Lifetime energy production',
|
||||
'icon': 'mdi:flash',
|
||||
'state_class': 'total_increasing',
|
||||
'unit_of_measurement': 'MWh',
|
||||
}),
|
||||
@ -321,7 +317,7 @@
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': 'power',
|
||||
'original_icon': 'mdi:flash',
|
||||
'original_icon': None,
|
||||
'original_name': None,
|
||||
'platform': 'enphase_envoy',
|
||||
'previous_unique_id': None,
|
||||
@ -334,7 +330,6 @@
|
||||
'attributes': dict({
|
||||
'device_class': 'power',
|
||||
'friendly_name': 'Inverter 1',
|
||||
'icon': 'mdi:flash',
|
||||
'state_class': 'measurement',
|
||||
'unit_of_measurement': 'W',
|
||||
}),
|
||||
@ -365,7 +360,7 @@
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': 'timestamp',
|
||||
'original_icon': 'mdi:flash',
|
||||
'original_icon': None,
|
||||
'original_name': 'Last reported',
|
||||
'platform': 'enphase_envoy',
|
||||
'previous_unique_id': None,
|
||||
@ -522,7 +517,7 @@
|
||||
}),
|
||||
}),
|
||||
'original_device_class': 'power',
|
||||
'original_icon': 'mdi:flash',
|
||||
'original_icon': None,
|
||||
'original_name': 'Current power production',
|
||||
'platform': 'enphase_envoy',
|
||||
'previous_unique_id': None,
|
||||
@ -535,7 +530,6 @@
|
||||
'attributes': dict({
|
||||
'device_class': 'power',
|
||||
'friendly_name': 'Envoy <<envoyserial>> Current power production',
|
||||
'icon': 'mdi:flash',
|
||||
'state_class': 'measurement',
|
||||
'unit_of_measurement': 'kW',
|
||||
}),
|
||||
@ -574,7 +568,7 @@
|
||||
}),
|
||||
}),
|
||||
'original_device_class': 'energy',
|
||||
'original_icon': 'mdi:flash',
|
||||
'original_icon': None,
|
||||
'original_name': 'Energy production today',
|
||||
'platform': 'enphase_envoy',
|
||||
'previous_unique_id': None,
|
||||
@ -587,7 +581,6 @@
|
||||
'attributes': dict({
|
||||
'device_class': 'energy',
|
||||
'friendly_name': 'Envoy <<envoyserial>> Energy production today',
|
||||
'icon': 'mdi:flash',
|
||||
'state_class': 'total_increasing',
|
||||
'unit_of_measurement': 'kWh',
|
||||
}),
|
||||
@ -624,7 +617,7 @@
|
||||
}),
|
||||
}),
|
||||
'original_device_class': 'energy',
|
||||
'original_icon': 'mdi:flash',
|
||||
'original_icon': None,
|
||||
'original_name': 'Energy production last seven days',
|
||||
'platform': 'enphase_envoy',
|
||||
'previous_unique_id': None,
|
||||
@ -637,7 +630,6 @@
|
||||
'attributes': dict({
|
||||
'device_class': 'energy',
|
||||
'friendly_name': 'Envoy <<envoyserial>> Energy production last seven days',
|
||||
'icon': 'mdi:flash',
|
||||
'unit_of_measurement': 'kWh',
|
||||
}),
|
||||
'entity_id': 'sensor.envoy_<<envoyserial>>_energy_production_last_seven_days',
|
||||
@ -675,7 +667,7 @@
|
||||
}),
|
||||
}),
|
||||
'original_device_class': 'energy',
|
||||
'original_icon': 'mdi:flash',
|
||||
'original_icon': None,
|
||||
'original_name': 'Lifetime energy production',
|
||||
'platform': 'enphase_envoy',
|
||||
'previous_unique_id': None,
|
||||
@ -688,7 +680,6 @@
|
||||
'attributes': dict({
|
||||
'device_class': 'energy',
|
||||
'friendly_name': 'Envoy <<envoyserial>> Lifetime energy production',
|
||||
'icon': 'mdi:flash',
|
||||
'state_class': 'total_increasing',
|
||||
'unit_of_measurement': 'MWh',
|
||||
}),
|
||||
@ -755,7 +746,7 @@
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': 'power',
|
||||
'original_icon': 'mdi:flash',
|
||||
'original_icon': None,
|
||||
'original_name': None,
|
||||
'platform': 'enphase_envoy',
|
||||
'previous_unique_id': None,
|
||||
@ -768,7 +759,6 @@
|
||||
'attributes': dict({
|
||||
'device_class': 'power',
|
||||
'friendly_name': 'Inverter 1',
|
||||
'icon': 'mdi:flash',
|
||||
'state_class': 'measurement',
|
||||
'unit_of_measurement': 'W',
|
||||
}),
|
||||
@ -799,7 +789,7 @@
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': 'timestamp',
|
||||
'original_icon': 'mdi:flash',
|
||||
'original_icon': None,
|
||||
'original_name': 'Last reported',
|
||||
'platform': 'enphase_envoy',
|
||||
'previous_unique_id': None,
|
||||
@ -996,7 +986,7 @@
|
||||
}),
|
||||
}),
|
||||
'original_device_class': 'power',
|
||||
'original_icon': 'mdi:flash',
|
||||
'original_icon': None,
|
||||
'original_name': 'Current power production',
|
||||
'platform': 'enphase_envoy',
|
||||
'previous_unique_id': None,
|
||||
@ -1009,7 +999,6 @@
|
||||
'attributes': dict({
|
||||
'device_class': 'power',
|
||||
'friendly_name': 'Envoy <<envoyserial>> Current power production',
|
||||
'icon': 'mdi:flash',
|
||||
'state_class': 'measurement',
|
||||
'unit_of_measurement': 'kW',
|
||||
}),
|
||||
@ -1048,7 +1037,7 @@
|
||||
}),
|
||||
}),
|
||||
'original_device_class': 'energy',
|
||||
'original_icon': 'mdi:flash',
|
||||
'original_icon': None,
|
||||
'original_name': 'Energy production today',
|
||||
'platform': 'enphase_envoy',
|
||||
'previous_unique_id': None,
|
||||
@ -1061,7 +1050,6 @@
|
||||
'attributes': dict({
|
||||
'device_class': 'energy',
|
||||
'friendly_name': 'Envoy <<envoyserial>> Energy production today',
|
||||
'icon': 'mdi:flash',
|
||||
'state_class': 'total_increasing',
|
||||
'unit_of_measurement': 'kWh',
|
||||
}),
|
||||
@ -1098,7 +1086,7 @@
|
||||
}),
|
||||
}),
|
||||
'original_device_class': 'energy',
|
||||
'original_icon': 'mdi:flash',
|
||||
'original_icon': None,
|
||||
'original_name': 'Energy production last seven days',
|
||||
'platform': 'enphase_envoy',
|
||||
'previous_unique_id': None,
|
||||
@ -1111,7 +1099,6 @@
|
||||
'attributes': dict({
|
||||
'device_class': 'energy',
|
||||
'friendly_name': 'Envoy <<envoyserial>> Energy production last seven days',
|
||||
'icon': 'mdi:flash',
|
||||
'unit_of_measurement': 'kWh',
|
||||
}),
|
||||
'entity_id': 'sensor.envoy_<<envoyserial>>_energy_production_last_seven_days',
|
||||
@ -1149,7 +1136,7 @@
|
||||
}),
|
||||
}),
|
||||
'original_device_class': 'energy',
|
||||
'original_icon': 'mdi:flash',
|
||||
'original_icon': None,
|
||||
'original_name': 'Lifetime energy production',
|
||||
'platform': 'enphase_envoy',
|
||||
'previous_unique_id': None,
|
||||
@ -1162,7 +1149,6 @@
|
||||
'attributes': dict({
|
||||
'device_class': 'energy',
|
||||
'friendly_name': 'Envoy <<envoyserial>> Lifetime energy production',
|
||||
'icon': 'mdi:flash',
|
||||
'state_class': 'total_increasing',
|
||||
'unit_of_measurement': 'MWh',
|
||||
}),
|
||||
@ -1229,7 +1215,7 @@
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': 'power',
|
||||
'original_icon': 'mdi:flash',
|
||||
'original_icon': None,
|
||||
'original_name': None,
|
||||
'platform': 'enphase_envoy',
|
||||
'previous_unique_id': None,
|
||||
@ -1242,7 +1228,6 @@
|
||||
'attributes': dict({
|
||||
'device_class': 'power',
|
||||
'friendly_name': 'Inverter 1',
|
||||
'icon': 'mdi:flash',
|
||||
'state_class': 'measurement',
|
||||
'unit_of_measurement': 'W',
|
||||
}),
|
||||
@ -1273,7 +1258,7 @@
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': 'timestamp',
|
||||
'original_icon': 'mdi:flash',
|
||||
'original_icon': None,
|
||||
'original_name': 'Last reported',
|
||||
'platform': 'enphase_envoy',
|
||||
'previous_unique_id': None,
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -165,7 +165,7 @@
|
||||
'platform': 'enphase_envoy',
|
||||
'previous_unique_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'translation_key': 'relay_status',
|
||||
'unique_id': '654321_relay_NC1_relay_status',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
@ -211,7 +211,7 @@
|
||||
'platform': 'enphase_envoy',
|
||||
'previous_unique_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'translation_key': 'relay_status',
|
||||
'unique_id': '654321_relay_NC2_relay_status',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
@ -257,7 +257,7 @@
|
||||
'platform': 'enphase_envoy',
|
||||
'previous_unique_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'translation_key': 'relay_status',
|
||||
'unique_id': '654321_relay_NC3_relay_status',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user