Add icon translations to Netgear (#111972)

This commit is contained in:
Joost Lekkerkerker 2024-03-02 12:42:00 +01:00 committed by GitHub
parent 0f71e45fe2
commit 0f66292d35
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 113 additions and 35 deletions

View File

@ -0,0 +1,113 @@
{
"entity": {
"sensor": {
"link_type": {
"default": "mdi:lan"
},
"link_rate": {
"default": "mdi:speedometer"
},
"signal_strength": {
"default": "mdi:wifi"
},
"ssid": {
"default": "mdi:wifi-marker"
},
"access_point_mac": {
"default": "mdi:router-network"
},
"upload_today": {
"default": "mdi:upload"
},
"download_today": {
"default": "mdi:download"
},
"upload_yesterday": {
"default": "mdi:upload"
},
"download_yesterday": {
"default": "mdi:download"
},
"upload_week": {
"default": "mdi:upload"
},
"upload_week_average": {
"default": "mdi:upload"
},
"download_week": {
"default": "mdi:download"
},
"download_week_average": {
"default": "mdi:download"
},
"upload_month": {
"default": "mdi:upload"
},
"upload_month_average": {
"default": "mdi:upload"
},
"download_month": {
"default": "mdi:download"
},
"download_month_average": {
"default": "mdi:download"
},
"upload_last_month": {
"default": "mdi:upload"
},
"upload_last_month_average": {
"default": "mdi:upload"
},
"download_last_month": {
"default": "mdi:download"
},
"download_last_month_average": {
"default": "mdi:download"
},
"uplink_bandwidth": {
"default": "mdi:upload"
},
"downlink_bandwidth": {
"default": "mdi:download"
},
"average_ping": {
"default": "mdi:wan"
},
"cpu_utilization": {
"default": "mdi:cpu-64-bit"
},
"memory_utilization": {
"default": "mdi:memory"
},
"ethernet_link_status": {
"default": "mdi:ethernet"
}
},
"switch": {
"allowed_on_network": {
"default": "mdi:block-helper"
},
"access_control": {
"default": "mdi:block-helper"
},
"traffic_meter": {
"default": "mdi:wifi-arrow-up-down"
},
"parental_control": {
"default": "mdi:account-child-outline"
},
"quality_of_service": {
"default": "mdi:wifi-star"
},
"2g_guest_wifi": {
"default": "mdi:wifi"
},
"5g_guest_wifi": {
"default": "mdi:wifi"
},
"smart_connect": {
"default": "mdi:wifi"
}
}
}
}

View File

@ -46,33 +46,28 @@ SENSOR_TYPES = {
key="type",
translation_key="link_type",
entity_category=EntityCategory.DIAGNOSTIC,
icon="mdi:lan",
),
"link_rate": SensorEntityDescription(
key="link_rate",
translation_key="link_rate",
native_unit_of_measurement="Mbps",
entity_category=EntityCategory.DIAGNOSTIC,
icon="mdi:speedometer",
),
"signal": SensorEntityDescription(
key="signal",
translation_key="signal_strength",
native_unit_of_measurement=PERCENTAGE,
entity_category=EntityCategory.DIAGNOSTIC,
icon="mdi:wifi",
),
"ssid": SensorEntityDescription(
key="ssid",
translation_key="ssid",
entity_category=EntityCategory.DIAGNOSTIC,
icon="mdi:wifi-marker",
),
"conn_ap_mac": SensorEntityDescription(
key="conn_ap_mac",
translation_key="access_point_mac",
entity_category=EntityCategory.DIAGNOSTIC,
icon="mdi:router-network",
),
}
@ -92,7 +87,6 @@ SENSOR_TRAFFIC_TYPES = [
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
icon="mdi:upload",
),
NetgearSensorEntityDescription(
key="NewTodayDownload",
@ -100,7 +94,6 @@ SENSOR_TRAFFIC_TYPES = [
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
icon="mdi:download",
),
NetgearSensorEntityDescription(
key="NewYesterdayUpload",
@ -108,7 +101,6 @@ SENSOR_TRAFFIC_TYPES = [
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
icon="mdi:upload",
),
NetgearSensorEntityDescription(
key="NewYesterdayDownload",
@ -116,7 +108,6 @@ SENSOR_TRAFFIC_TYPES = [
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
icon="mdi:download",
),
NetgearSensorEntityDescription(
key="NewWeekUpload",
@ -124,7 +115,6 @@ SENSOR_TRAFFIC_TYPES = [
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
icon="mdi:upload",
index=0,
value=lambda data: data[0],
),
@ -134,7 +124,6 @@ SENSOR_TRAFFIC_TYPES = [
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
icon="mdi:upload",
index=1,
value=lambda data: data[1],
),
@ -144,7 +133,6 @@ SENSOR_TRAFFIC_TYPES = [
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
icon="mdi:download",
index=0,
value=lambda data: data[0],
),
@ -154,7 +142,6 @@ SENSOR_TRAFFIC_TYPES = [
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
icon="mdi:download",
index=1,
value=lambda data: data[1],
),
@ -164,7 +151,6 @@ SENSOR_TRAFFIC_TYPES = [
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
icon="mdi:upload",
index=0,
value=lambda data: data[0],
),
@ -174,7 +160,6 @@ SENSOR_TRAFFIC_TYPES = [
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
icon="mdi:upload",
index=1,
value=lambda data: data[1],
),
@ -184,7 +169,6 @@ SENSOR_TRAFFIC_TYPES = [
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
icon="mdi:download",
index=0,
value=lambda data: data[0],
),
@ -194,7 +178,6 @@ SENSOR_TRAFFIC_TYPES = [
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
icon="mdi:download",
index=1,
value=lambda data: data[1],
),
@ -204,7 +187,6 @@ SENSOR_TRAFFIC_TYPES = [
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
icon="mdi:upload",
index=0,
value=lambda data: data[0],
),
@ -214,7 +196,6 @@ SENSOR_TRAFFIC_TYPES = [
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
icon="mdi:upload",
index=1,
value=lambda data: data[1],
),
@ -224,7 +205,6 @@ SENSOR_TRAFFIC_TYPES = [
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
icon="mdi:download",
index=0,
value=lambda data: data[0],
),
@ -234,7 +214,6 @@ SENSOR_TRAFFIC_TYPES = [
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
icon="mdi:download",
index=1,
value=lambda data: data[1],
),
@ -247,7 +226,6 @@ SENSOR_SPEED_TYPES = [
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfDataRate.MEGABITS_PER_SECOND,
device_class=SensorDeviceClass.DATA_RATE,
icon="mdi:upload",
),
NetgearSensorEntityDescription(
key="NewOOKLADownlinkBandwidth",
@ -255,14 +233,12 @@ SENSOR_SPEED_TYPES = [
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfDataRate.MEGABITS_PER_SECOND,
device_class=SensorDeviceClass.DATA_RATE,
icon="mdi:download",
),
NetgearSensorEntityDescription(
key="AveragePing",
translation_key="average_ping",
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfTime.MILLISECONDS,
icon="mdi:wan",
),
]
@ -272,7 +248,6 @@ SENSOR_UTILIZATION = [
translation_key="cpu_utilization",
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=PERCENTAGE,
icon="mdi:cpu-64-bit",
state_class=SensorStateClass.MEASUREMENT,
),
NetgearSensorEntityDescription(
@ -280,7 +255,6 @@ SENSOR_UTILIZATION = [
translation_key="memory_utilization",
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=PERCENTAGE,
icon="mdi:memory",
state_class=SensorStateClass.MEASUREMENT,
),
]
@ -290,7 +264,6 @@ SENSOR_LINK_TYPES = [
key="NewEthernetLinkStatus",
translation_key="ethernet_link_status",
entity_category=EntityCategory.DIAGNOSTIC,
icon="mdi:ethernet",
),
]

View File

@ -26,7 +26,6 @@ SWITCH_TYPES = [
SwitchEntityDescription(
key="allow_or_block",
translation_key="allowed_on_network",
icon="mdi:block-helper",
entity_category=EntityCategory.CONFIG,
)
]
@ -51,7 +50,6 @@ ROUTER_SWITCH_TYPES = [
NetgearSwitchEntityDescription(
key="access_control",
translation_key="access_control",
icon="mdi:block-helper",
entity_category=EntityCategory.CONFIG,
update=lambda router: router.api.get_block_device_enable_status,
action=lambda router: router.api.set_block_device_enable,
@ -59,7 +57,6 @@ ROUTER_SWITCH_TYPES = [
NetgearSwitchEntityDescription(
key="traffic_meter",
translation_key="traffic_meter",
icon="mdi:wifi-arrow-up-down",
entity_category=EntityCategory.CONFIG,
update=lambda router: router.api.get_traffic_meter_enabled,
action=lambda router: router.api.enable_traffic_meter,
@ -67,7 +64,6 @@ ROUTER_SWITCH_TYPES = [
NetgearSwitchEntityDescription(
key="parental_control",
translation_key="parental_control",
icon="mdi:account-child-outline",
entity_category=EntityCategory.CONFIG,
update=lambda router: router.api.get_parental_control_enable_status,
action=lambda router: router.api.enable_parental_control,
@ -75,7 +71,6 @@ ROUTER_SWITCH_TYPES = [
NetgearSwitchEntityDescription(
key="qos",
translation_key="quality_of_service",
icon="mdi:wifi-star",
entity_category=EntityCategory.CONFIG,
update=lambda router: router.api.get_qos_enable_status,
action=lambda router: router.api.set_qos_enable_status,
@ -83,7 +78,6 @@ ROUTER_SWITCH_TYPES = [
NetgearSwitchEntityDescription(
key="2g_guest_wifi",
translation_key="2g_guest_wifi",
icon="mdi:wifi",
entity_category=EntityCategory.CONFIG,
update=lambda router: router.api.get_2g_guest_access_enabled,
action=lambda router: router.api.set_2g_guest_access_enabled,
@ -91,7 +85,6 @@ ROUTER_SWITCH_TYPES = [
NetgearSwitchEntityDescription(
key="5g_guest_wifi",
translation_key="5g_guest_wifi",
icon="mdi:wifi",
entity_category=EntityCategory.CONFIG,
update=lambda router: router.api.get_5g_guest_access_enabled,
action=lambda router: router.api.set_5g_guest_access_enabled,
@ -99,7 +92,6 @@ ROUTER_SWITCH_TYPES = [
NetgearSwitchEntityDescription(
key="smart_connect",
translation_key="smart_connect",
icon="mdi:wifi",
entity_category=EntityCategory.CONFIG,
update=lambda router: router.api.get_smart_connect_enabled,
action=lambda router: router.api.set_smart_connect_enabled,