Skip to content

Commit

Permalink
Add Netgear entity translations (#100367)
Browse files Browse the repository at this point in the history
Co-authored-by: Joost Lekkerkerker <[email protected]>
  • Loading branch information
starkillerOG and joostlek authored Sep 14, 2023
1 parent 6fc1407 commit 7ea2087
Show file tree
Hide file tree
Showing 3 changed files with 146 additions and 35 deletions.
54 changes: 27 additions & 27 deletions homeassistant/components/netgear/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,33 +44,33 @@
SENSOR_TYPES = {
"type": SensorEntityDescription(
key="type",
name="link type",
translation_key="link_type",
entity_category=EntityCategory.DIAGNOSTIC,
icon="mdi:lan",
),
"link_rate": SensorEntityDescription(
key="link_rate",
name="link rate",
translation_key="link_rate",
native_unit_of_measurement="Mbps",
entity_category=EntityCategory.DIAGNOSTIC,
icon="mdi:speedometer",
),
"signal": SensorEntityDescription(
key="signal",
name="signal strength",
translation_key="signal_strength",
native_unit_of_measurement=PERCENTAGE,
entity_category=EntityCategory.DIAGNOSTIC,
icon="mdi:wifi",
),
"ssid": SensorEntityDescription(
key="ssid",
name="ssid",
translation_key="ssid",
entity_category=EntityCategory.DIAGNOSTIC,
icon="mdi:wifi-marker",
),
"conn_ap_mac": SensorEntityDescription(
key="conn_ap_mac",
name="access point mac",
translation_key="access_point_mac",
entity_category=EntityCategory.DIAGNOSTIC,
icon="mdi:router-network",
),
Expand All @@ -88,39 +88,39 @@ class NetgearSensorEntityDescription(SensorEntityDescription):
SENSOR_TRAFFIC_TYPES = [
NetgearSensorEntityDescription(
key="NewTodayUpload",
name="Upload today",
translation_key="upload_today",
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
icon="mdi:upload",
),
NetgearSensorEntityDescription(
key="NewTodayDownload",
name="Download today",
translation_key="download_today",
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
icon="mdi:download",
),
NetgearSensorEntityDescription(
key="NewYesterdayUpload",
name="Upload yesterday",
translation_key="upload_yesterday",
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
icon="mdi:upload",
),
NetgearSensorEntityDescription(
key="NewYesterdayDownload",
name="Download yesterday",
translation_key="download_yesterday",
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
icon="mdi:download",
),
NetgearSensorEntityDescription(
key="NewWeekUpload",
name="Upload week",
translation_key="upload_week",
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
Expand All @@ -130,7 +130,7 @@ class NetgearSensorEntityDescription(SensorEntityDescription):
),
NetgearSensorEntityDescription(
key="NewWeekUpload",
name="Upload week average",
translation_key="upload_week_average",
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
Expand All @@ -140,7 +140,7 @@ class NetgearSensorEntityDescription(SensorEntityDescription):
),
NetgearSensorEntityDescription(
key="NewWeekDownload",
name="Download week",
translation_key="download_week",
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
Expand All @@ -150,7 +150,7 @@ class NetgearSensorEntityDescription(SensorEntityDescription):
),
NetgearSensorEntityDescription(
key="NewWeekDownload",
name="Download week average",
translation_key="download_week_average",
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
Expand All @@ -160,7 +160,7 @@ class NetgearSensorEntityDescription(SensorEntityDescription):
),
NetgearSensorEntityDescription(
key="NewMonthUpload",
name="Upload month",
translation_key="upload_month",
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
Expand All @@ -170,7 +170,7 @@ class NetgearSensorEntityDescription(SensorEntityDescription):
),
NetgearSensorEntityDescription(
key="NewMonthUpload",
name="Upload month average",
translation_key="upload_month_average",
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
Expand All @@ -180,7 +180,7 @@ class NetgearSensorEntityDescription(SensorEntityDescription):
),
NetgearSensorEntityDescription(
key="NewMonthDownload",
name="Download month",
translation_key="download_month",
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
Expand All @@ -190,7 +190,7 @@ class NetgearSensorEntityDescription(SensorEntityDescription):
),
NetgearSensorEntityDescription(
key="NewMonthDownload",
name="Download month average",
translation_key="download_month_average",
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
Expand All @@ -200,7 +200,7 @@ class NetgearSensorEntityDescription(SensorEntityDescription):
),
NetgearSensorEntityDescription(
key="NewLastMonthUpload",
name="Upload last month",
translation_key="upload_last_month",
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
Expand All @@ -210,7 +210,7 @@ class NetgearSensorEntityDescription(SensorEntityDescription):
),
NetgearSensorEntityDescription(
key="NewLastMonthUpload",
name="Upload last month average",
translation_key="upload_last_month_average",
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
Expand All @@ -220,7 +220,7 @@ class NetgearSensorEntityDescription(SensorEntityDescription):
),
NetgearSensorEntityDescription(
key="NewLastMonthDownload",
name="Download last month",
translation_key="download_last_month",
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
Expand All @@ -230,7 +230,7 @@ class NetgearSensorEntityDescription(SensorEntityDescription):
),
NetgearSensorEntityDescription(
key="NewLastMonthDownload",
name="Download last month average",
translation_key="download_last_month_average",
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
Expand All @@ -243,23 +243,23 @@ class NetgearSensorEntityDescription(SensorEntityDescription):
SENSOR_SPEED_TYPES = [
NetgearSensorEntityDescription(
key="NewOOKLAUplinkBandwidth",
name="Uplink Bandwidth",
translation_key="uplink_bandwidth",
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfDataRate.MEGABITS_PER_SECOND,
device_class=SensorDeviceClass.DATA_RATE,
icon="mdi:upload",
),
NetgearSensorEntityDescription(
key="NewOOKLADownlinkBandwidth",
name="Downlink Bandwidth",
translation_key="downlink_bandwidth",
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfDataRate.MEGABITS_PER_SECOND,
device_class=SensorDeviceClass.DATA_RATE,
icon="mdi:download",
),
NetgearSensorEntityDescription(
key="AveragePing",
name="Average Ping",
translation_key="average_ping",
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfTime.MILLISECONDS,
icon="mdi:wan",
Expand All @@ -269,15 +269,15 @@ class NetgearSensorEntityDescription(SensorEntityDescription):
SENSOR_UTILIZATION = [
NetgearSensorEntityDescription(
key="NewCPUUtilization",
name="CPU Utilization",
translation_key="cpu_utilization",
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=PERCENTAGE,
icon="mdi:cpu-64-bit",
state_class=SensorStateClass.MEASUREMENT,
),
NetgearSensorEntityDescription(
key="NewMemoryUtilization",
name="Memory Utilization",
translation_key="memory_utilization",
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=PERCENTAGE,
icon="mdi:memory",
Expand All @@ -288,7 +288,7 @@ class NetgearSensorEntityDescription(SensorEntityDescription):
SENSOR_LINK_TYPES = [
NetgearSensorEntityDescription(
key="NewEthernetLinkStatus",
name="Ethernet Link Status",
translation_key="ethernet_link_status",
entity_category=EntityCategory.DIAGNOSTIC,
icon="mdi:ethernet",
),
Expand Down
111 changes: 111 additions & 0 deletions homeassistant/components/netgear/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,116 @@
}
}
}
},
"entity": {
"sensor": {
"link_type": {
"name": "Link type"
},
"link_rate": {
"name": "Link rate"
},
"signal_strength": {
"name": "[%key:component::sensor::entity_component::signal_strength::name%]"
},
"ssid": {
"name": "SSID"
},
"access_point_mac": {
"name": "Access point mac"
},
"upload_today": {
"name": "Upload today"
},
"download_today": {
"name": "Download today"
},
"upload_yesterday": {
"name": "Upload yesterday"
},
"download_yesterday": {
"name": "Download yesterday"
},
"upload_week": {
"name": "Upload this week"
},
"upload_week_average": {
"name": "Upload this week average"
},
"download_week": {
"name": "Download this week"
},
"download_week_average": {
"name": "Download this week average"
},
"upload_month": {
"name": "Upload this month"
},
"upload_month_average": {
"name": "Upload this month average"
},
"download_month": {
"name": "Download this month"
},
"download_month_average": {
"name": "Download this month average"
},
"upload_last_month": {
"name": "Upload last month"
},
"upload_last_month_average": {
"name": "Upload last month average"
},
"download_last_month": {
"name": "Download last month"
},
"download_last_month_average": {
"name": "Download last month average"
},
"uplink_bandwidth": {
"name": "Uplink bandwidth"
},
"downlink_bandwidth": {
"name": "Downlink bandwidth"
},
"average_ping": {
"name": "Average ping"
},
"cpu_utilization": {
"name": "CPU utilization"
},
"memory_utilization": {
"name": "Memory utilization"
},
"ethernet_link_status": {
"name": "Ethernet link status"
}
},
"switch": {
"allowed_on_network": {
"name": "Allowed on network"
},
"access_control": {
"name": "Access control"
},
"traffic_meter": {
"name": "Traffic meter"
},
"parental_control": {
"name": "Parental control"
},
"quality_of_service": {
"name": "Quality of service"
},
"2g_guest_wifi": {
"name": "2.4GHz guest Wi-Fi"
},
"5g_guest_wifi": {
"name": "5GHz guest Wi-Fi"
},
"smart_connect": {
"name": "Smart connect"
}
}
}
}
Loading

0 comments on commit 7ea2087

Please sign in to comment.