Add icon translations to Huawei LTE (#111724)
* Add icon translations to Huawei LTE * Add icon translations to Huawei LTE
This commit is contained in:
parent
69bb827a20
commit
e28f551cb0
4 changed files with 59 additions and 26 deletions
|
@ -125,11 +125,6 @@ class HuaweiLteMobileConnectionBinarySensor(HuaweiLteBaseBinarySensor):
|
||||||
ConnectionStatusEnum.DISCONNECTED,
|
ConnectionStatusEnum.DISCONNECTED,
|
||||||
)
|
)
|
||||||
|
|
||||||
@property
|
|
||||||
def icon(self) -> str:
|
|
||||||
"""Return mobile connectivity sensor icon."""
|
|
||||||
return "mdi:signal" if self.is_on else "mdi:signal-off"
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def extra_state_attributes(self) -> dict[str, Any] | None:
|
def extra_state_attributes(self) -> dict[str, Any] | None:
|
||||||
"""Get additional attributes related to connection status."""
|
"""Get additional attributes related to connection status."""
|
||||||
|
@ -154,11 +149,6 @@ class HuaweiLteBaseWifiStatusBinarySensor(HuaweiLteBaseBinarySensor):
|
||||||
"""Return True if real state is assumed, not known."""
|
"""Return True if real state is assumed, not known."""
|
||||||
return self._raw_state is None
|
return self._raw_state is None
|
||||||
|
|
||||||
@property
|
|
||||||
def icon(self) -> str:
|
|
||||||
"""Return WiFi status sensor icon."""
|
|
||||||
return "mdi:wifi" if self.is_on else "mdi:wifi-off"
|
|
||||||
|
|
||||||
|
|
||||||
class HuaweiLteWifiStatusBinarySensor(HuaweiLteBaseWifiStatusBinarySensor):
|
class HuaweiLteWifiStatusBinarySensor(HuaweiLteBaseWifiStatusBinarySensor):
|
||||||
"""Huawei LTE WiFi status binary sensor."""
|
"""Huawei LTE WiFi status binary sensor."""
|
||||||
|
@ -204,8 +194,3 @@ class HuaweiLteSmsStorageFullBinarySensor(HuaweiLteBaseBinarySensor):
|
||||||
def assumed_state(self) -> bool:
|
def assumed_state(self) -> bool:
|
||||||
"""Return True if real state is assumed, not known."""
|
"""Return True if real state is assumed, not known."""
|
||||||
return self._raw_state is None
|
return self._raw_state is None
|
||||||
|
|
||||||
@property
|
|
||||||
def icon(self) -> str:
|
|
||||||
"""Return WiFi status sensor icon."""
|
|
||||||
return "mdi:email-alert" if self.is_on else "mdi:email-off"
|
|
||||||
|
|
59
homeassistant/components/huawei_lte/icons.json
Normal file
59
homeassistant/components/huawei_lte/icons.json
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
{
|
||||||
|
"entity": {
|
||||||
|
"binary_sensor": {
|
||||||
|
"mobile_connection": {
|
||||||
|
"default": "mdi:signal-off",
|
||||||
|
"state": {
|
||||||
|
"on": "mdi:signal"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"wifi_status": {
|
||||||
|
"default": "mdi:wifi-off",
|
||||||
|
"state": {
|
||||||
|
"on": "mdi:wifi"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"24ghz_wifi_status": {
|
||||||
|
"default": "mdi:wifi-off",
|
||||||
|
"state": {
|
||||||
|
"on": "mdi:wifi"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"5ghz_wifi_status": {
|
||||||
|
"default": "mdi:wifi-off",
|
||||||
|
"state": {
|
||||||
|
"on": "mdi:wifi"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sms_storage_full": {
|
||||||
|
"default": "mdi:email-off",
|
||||||
|
"state": {
|
||||||
|
"on": "mdi:email-alert"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"select": {
|
||||||
|
"preferred_network_mode": {
|
||||||
|
"default": "mdi:transmission-tower"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"switch": {
|
||||||
|
"mobile_data": {
|
||||||
|
"default": "mdi:signal-off",
|
||||||
|
"state": {
|
||||||
|
"on": "mdi:signal"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"wifi_guest_network": {
|
||||||
|
"default": "mdi:wifi-off",
|
||||||
|
"state": {
|
||||||
|
"on": "mdi:wifi"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"services": {
|
||||||
|
"resume_integration": "mdi:play-pause",
|
||||||
|
"suspend_integration": "mdi:pause"
|
||||||
|
}
|
||||||
|
}
|
|
@ -50,7 +50,6 @@ async def async_setup_entry(
|
||||||
desc = HuaweiSelectEntityDescription(
|
desc = HuaweiSelectEntityDescription(
|
||||||
key=KEY_NET_NET_MODE,
|
key=KEY_NET_NET_MODE,
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
icon="mdi:transmission-tower",
|
|
||||||
name="Preferred network mode",
|
name="Preferred network mode",
|
||||||
translation_key="preferred_network_mode",
|
translation_key="preferred_network_mode",
|
||||||
options=[
|
options=[
|
||||||
|
|
|
@ -107,11 +107,6 @@ class HuaweiLteMobileDataSwitch(HuaweiLteBaseSwitch):
|
||||||
self._raw_state = str(value)
|
self._raw_state = str(value)
|
||||||
self.schedule_update_ha_state()
|
self.schedule_update_ha_state()
|
||||||
|
|
||||||
@property
|
|
||||||
def icon(self) -> str:
|
|
||||||
"""Return switch icon."""
|
|
||||||
return "mdi:signal" if self.is_on else "mdi:signal-off"
|
|
||||||
|
|
||||||
|
|
||||||
class HuaweiLteWifiGuestNetworkSwitch(HuaweiLteBaseSwitch):
|
class HuaweiLteWifiGuestNetworkSwitch(HuaweiLteBaseSwitch):
|
||||||
"""Huawei LTE WiFi guest network switch device."""
|
"""Huawei LTE WiFi guest network switch device."""
|
||||||
|
@ -135,11 +130,6 @@ class HuaweiLteWifiGuestNetworkSwitch(HuaweiLteBaseSwitch):
|
||||||
self._raw_state = "1" if state else "0"
|
self._raw_state = "1" if state else "0"
|
||||||
self.schedule_update_ha_state()
|
self.schedule_update_ha_state()
|
||||||
|
|
||||||
@property
|
|
||||||
def icon(self) -> str:
|
|
||||||
"""Return switch icon."""
|
|
||||||
return "mdi:wifi" if self.is_on else "mdi:wifi-off"
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def extra_state_attributes(self) -> dict[str, str | None]:
|
def extra_state_attributes(self) -> dict[str, str | None]:
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
|
|
Loading…
Add table
Reference in a new issue