Add icon translations to Devolo home network (#111367)
parent
b629f5c143
commit
38ba966d74
|
@ -52,7 +52,6 @@ SENSOR_TYPES: dict[str, DevoloBinarySensorEntityDescription] = {
|
|||
device_class=BinarySensorDeviceClass.PLUG,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
entity_registry_enabled_default=False,
|
||||
icon="mdi:router-network",
|
||||
value_func=_is_connected_to_router,
|
||||
),
|
||||
}
|
||||
|
|
|
@ -40,12 +40,11 @@ BUTTON_TYPES: dict[str, DevoloButtonEntityDescription] = {
|
|||
IDENTIFY: DevoloButtonEntityDescription(
|
||||
key=IDENTIFY,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
icon="mdi:led-on",
|
||||
device_class=ButtonDeviceClass.IDENTIFY,
|
||||
press_func=lambda device: device.plcnet.async_identify_device_start(), # type: ignore[union-attr]
|
||||
),
|
||||
PAIRING: DevoloButtonEntityDescription(
|
||||
key=PAIRING,
|
||||
icon="mdi:plus-network-outline",
|
||||
press_func=lambda device: device.plcnet.async_pair_device(), # type: ignore[union-attr]
|
||||
),
|
||||
RESTART: DevoloButtonEntityDescription(
|
||||
|
@ -56,7 +55,6 @@ BUTTON_TYPES: dict[str, DevoloButtonEntityDescription] = {
|
|||
),
|
||||
START_WPS: DevoloButtonEntityDescription(
|
||||
key=START_WPS,
|
||||
icon="mdi:wifi-plus",
|
||||
press_func=lambda device: device.device.async_start_wps(), # type: ignore[union-attr]
|
||||
),
|
||||
}
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"entity": {
|
||||
"binary_sensor": {
|
||||
"connected_to_router": {
|
||||
"default": "mdi:router-network"
|
||||
}
|
||||
},
|
||||
"button": {
|
||||
"pairing": {
|
||||
"default": "mdi:plus-network-outline"
|
||||
},
|
||||
"start_wps": {
|
||||
"default": "mdi:wifi-plus"
|
||||
}
|
||||
},
|
||||
"sensor": {
|
||||
"connected_plc_devices": {
|
||||
"default": "mdi:lan"
|
||||
},
|
||||
"connected_wifi_clients": {
|
||||
"default": "mdi:wifi"
|
||||
},
|
||||
"neighboring_wifi_networks": {
|
||||
"default": "mdi:wifi-marker"
|
||||
}
|
||||
},
|
||||
"switch": {
|
||||
"switch_guest_wifi": {
|
||||
"default": "mdi:wifi"
|
||||
},
|
||||
"switch_leds": {
|
||||
"default": "mdi:led-off"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -68,14 +68,12 @@ SENSOR_TYPES: dict[str, DevoloSensorEntityDescription[Any]] = {
|
|||
key=CONNECTED_PLC_DEVICES,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
entity_registry_enabled_default=False,
|
||||
icon="mdi:lan",
|
||||
value_func=lambda data: len(
|
||||
{device.mac_address_from for device in data.data_rates}
|
||||
),
|
||||
),
|
||||
CONNECTED_WIFI_CLIENTS: DevoloSensorEntityDescription[list[ConnectedStationInfo]](
|
||||
key=CONNECTED_WIFI_CLIENTS,
|
||||
icon="mdi:wifi",
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
value_func=len,
|
||||
),
|
||||
|
@ -83,7 +81,6 @@ SENSOR_TYPES: dict[str, DevoloSensorEntityDescription[Any]] = {
|
|||
key=NEIGHBORING_WIFI_NETWORKS,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
entity_registry_enabled_default=False,
|
||||
icon="mdi:wifi-marker",
|
||||
value_func=len,
|
||||
),
|
||||
PLC_RX_RATE: DevoloSensorEntityDescription[DataRate](
|
||||
|
|
|
@ -42,7 +42,6 @@ class DevoloSwitchEntityDescription(
|
|||
SWITCH_TYPES: dict[str, DevoloSwitchEntityDescription[Any]] = {
|
||||
SWITCH_GUEST_WIFI: DevoloSwitchEntityDescription[WifiGuestAccessGet](
|
||||
key=SWITCH_GUEST_WIFI,
|
||||
icon="mdi:wifi",
|
||||
is_on_func=lambda data: data.enabled is True,
|
||||
turn_on_func=lambda device: device.device.async_set_wifi_guest_access(True), # type: ignore[union-attr]
|
||||
turn_off_func=lambda device: device.device.async_set_wifi_guest_access(False), # type: ignore[union-attr]
|
||||
|
@ -50,7 +49,6 @@ SWITCH_TYPES: dict[str, DevoloSwitchEntityDescription[Any]] = {
|
|||
SWITCH_LEDS: DevoloSwitchEntityDescription[bool](
|
||||
key=SWITCH_LEDS,
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
icon="mdi:led-off",
|
||||
is_on_func=bool,
|
||||
turn_on_func=lambda device: device.device.async_set_led_setting(True), # type: ignore[union-attr]
|
||||
turn_off_func=lambda device: device.device.async_set_led_setting(False), # type: ignore[union-attr]
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
'attributes': ReadOnlyDict({
|
||||
'device_class': 'plug',
|
||||
'friendly_name': 'Mock Title Connected to router',
|
||||
'icon': 'mdi:router-network',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'binary_sensor.mock_title_connected_to_router',
|
||||
|
@ -36,7 +35,7 @@
|
|||
'options': dict({
|
||||
}),
|
||||
'original_device_class': <BinarySensorDeviceClass.PLUG: 'plug'>,
|
||||
'original_icon': 'mdi:router-network',
|
||||
'original_icon': None,
|
||||
'original_name': 'Connected to router',
|
||||
'platform': 'devolo_home_network',
|
||||
'previous_unique_id': None,
|
||||
|
|
|
@ -45,8 +45,8 @@
|
|||
# name: test_button[identify_device_with_a_blinking_led-plcnet-async_identify_device_start]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'device_class': 'identify',
|
||||
'friendly_name': 'Mock Title Identify device with a blinking LED',
|
||||
'icon': 'mdi:led-on',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'button.mock_title_identify_device_with_a_blinking_led',
|
||||
|
@ -77,8 +77,8 @@
|
|||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': 'mdi:led-on',
|
||||
'original_device_class': <ButtonDeviceClass.IDENTIFY: 'identify'>,
|
||||
'original_icon': None,
|
||||
'original_name': 'Identify device with a blinking LED',
|
||||
'platform': 'devolo_home_network',
|
||||
'previous_unique_id': None,
|
||||
|
@ -224,7 +224,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Mock Title Start PLC pairing',
|
||||
'icon': 'mdi:plus-network-outline',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'button.mock_title_start_plc_pairing',
|
||||
|
@ -256,7 +255,7 @@
|
|||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': 'mdi:plus-network-outline',
|
||||
'original_icon': None,
|
||||
'original_name': 'Start PLC pairing',
|
||||
'platform': 'devolo_home_network',
|
||||
'previous_unique_id': None,
|
||||
|
@ -313,7 +312,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Mock Title Start WPS',
|
||||
'icon': 'mdi:wifi-plus',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'button.mock_title_start_wps',
|
||||
|
@ -345,7 +343,7 @@
|
|||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': 'mdi:wifi-plus',
|
||||
'original_icon': None,
|
||||
'original_name': 'Start WPS',
|
||||
'platform': 'devolo_home_network',
|
||||
'previous_unique_id': None,
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Mock Title Connected PLC devices',
|
||||
'icon': 'mdi:lan',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.mock_title_connected_plc_devices',
|
||||
|
@ -35,7 +34,7 @@
|
|||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': 'mdi:lan',
|
||||
'original_icon': None,
|
||||
'original_name': 'Connected PLC devices',
|
||||
'platform': 'devolo_home_network',
|
||||
'previous_unique_id': None,
|
||||
|
@ -49,7 +48,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Mock Title Connected Wifi clients',
|
||||
'icon': 'mdi:wifi',
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
}),
|
||||
'context': <ANY>,
|
||||
|
@ -84,7 +82,7 @@
|
|||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': 'mdi:wifi',
|
||||
'original_icon': None,
|
||||
'original_name': 'Connected Wifi clients',
|
||||
'platform': 'devolo_home_network',
|
||||
'previous_unique_id': None,
|
||||
|
@ -98,7 +96,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Mock Title Neighboring Wifi networks',
|
||||
'icon': 'mdi:wifi-marker',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.mock_title_neighboring_wifi_networks',
|
||||
|
@ -130,7 +127,7 @@
|
|||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': 'mdi:wifi-marker',
|
||||
'original_icon': None,
|
||||
'original_name': 'Neighboring Wifi networks',
|
||||
'platform': 'devolo_home_network',
|
||||
'previous_unique_id': None,
|
||||
|
|
|
@ -89,7 +89,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Mock Title Enable guest Wifi',
|
||||
'icon': 'mdi:wifi',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'switch.mock_title_enable_guest_wifi',
|
||||
|
@ -121,7 +120,7 @@
|
|||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': 'mdi:wifi',
|
||||
'original_icon': None,
|
||||
'original_name': 'Enable guest Wifi',
|
||||
'platform': 'devolo_home_network',
|
||||
'previous_unique_id': None,
|
||||
|
@ -135,7 +134,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Mock Title Enable LEDs',
|
||||
'icon': 'mdi:led-off',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'switch.mock_title_enable_leds',
|
||||
|
@ -167,7 +165,7 @@
|
|||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': 'mdi:led-off',
|
||||
'original_icon': None,
|
||||
'original_name': 'Enable LEDs',
|
||||
'platform': 'devolo_home_network',
|
||||
'previous_unique_id': None,
|
||||
|
|
Loading…
Reference in New Issue