Add Netgear entity translations (#100367)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>pull/100374/head
parent
6fc1407613
commit
7ea2087c45
|
@ -44,33 +44,33 @@ _LOGGER = logging.getLogger(__name__)
|
|||
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",
|
||||
),
|
||||
|
@ -88,7 +88,7 @@ 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,
|
||||
|
@ -96,7 +96,7 @@ SENSOR_TRAFFIC_TYPES = [
|
|||
),
|
||||
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,
|
||||
|
@ -104,7 +104,7 @@ SENSOR_TRAFFIC_TYPES = [
|
|||
),
|
||||
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,
|
||||
|
@ -112,7 +112,7 @@ SENSOR_TRAFFIC_TYPES = [
|
|||
),
|
||||
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,
|
||||
|
@ -120,7 +120,7 @@ SENSOR_TRAFFIC_TYPES = [
|
|||
),
|
||||
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,
|
||||
|
@ -130,7 +130,7 @@ SENSOR_TRAFFIC_TYPES = [
|
|||
),
|
||||
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,
|
||||
|
@ -140,7 +140,7 @@ SENSOR_TRAFFIC_TYPES = [
|
|||
),
|
||||
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,
|
||||
|
@ -150,7 +150,7 @@ SENSOR_TRAFFIC_TYPES = [
|
|||
),
|
||||
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,
|
||||
|
@ -160,7 +160,7 @@ SENSOR_TRAFFIC_TYPES = [
|
|||
),
|
||||
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,
|
||||
|
@ -170,7 +170,7 @@ SENSOR_TRAFFIC_TYPES = [
|
|||
),
|
||||
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,
|
||||
|
@ -180,7 +180,7 @@ SENSOR_TRAFFIC_TYPES = [
|
|||
),
|
||||
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,
|
||||
|
@ -190,7 +190,7 @@ SENSOR_TRAFFIC_TYPES = [
|
|||
),
|
||||
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,
|
||||
|
@ -200,7 +200,7 @@ SENSOR_TRAFFIC_TYPES = [
|
|||
),
|
||||
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,
|
||||
|
@ -210,7 +210,7 @@ SENSOR_TRAFFIC_TYPES = [
|
|||
),
|
||||
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,
|
||||
|
@ -220,7 +220,7 @@ SENSOR_TRAFFIC_TYPES = [
|
|||
),
|
||||
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,
|
||||
|
@ -230,7 +230,7 @@ SENSOR_TRAFFIC_TYPES = [
|
|||
),
|
||||
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,
|
||||
|
@ -243,7 +243,7 @@ SENSOR_TRAFFIC_TYPES = [
|
|||
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,
|
||||
|
@ -251,7 +251,7 @@ SENSOR_SPEED_TYPES = [
|
|||
),
|
||||
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,
|
||||
|
@ -259,7 +259,7 @@ SENSOR_SPEED_TYPES = [
|
|||
),
|
||||
NetgearSensorEntityDescription(
|
||||
key="AveragePing",
|
||||
name="Average Ping",
|
||||
translation_key="average_ping",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
native_unit_of_measurement=UnitOfTime.MILLISECONDS,
|
||||
icon="mdi:wan",
|
||||
|
@ -269,7 +269,7 @@ SENSOR_SPEED_TYPES = [
|
|||
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",
|
||||
|
@ -277,7 +277,7 @@ SENSOR_UTILIZATION = [
|
|||
),
|
||||
NetgearSensorEntityDescription(
|
||||
key="NewMemoryUtilization",
|
||||
name="Memory Utilization",
|
||||
translation_key="memory_utilization",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
icon="mdi:memory",
|
||||
|
@ -288,7 +288,7 @@ SENSOR_UTILIZATION = [
|
|||
SENSOR_LINK_TYPES = [
|
||||
NetgearSensorEntityDescription(
|
||||
key="NewEthernetLinkStatus",
|
||||
name="Ethernet Link Status",
|
||||
translation_key="ethernet_link_status",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
icon="mdi:ethernet",
|
||||
),
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ SCAN_INTERVAL = timedelta(seconds=300)
|
|||
SWITCH_TYPES = [
|
||||
SwitchEntityDescription(
|
||||
key="allow_or_block",
|
||||
name="Allowed on network",
|
||||
translation_key="allowed_on_network",
|
||||
icon="mdi:block-helper",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
)
|
||||
|
@ -50,7 +50,7 @@ class NetgearSwitchEntityDescription(
|
|||
ROUTER_SWITCH_TYPES = [
|
||||
NetgearSwitchEntityDescription(
|
||||
key="access_control",
|
||||
name="Access Control",
|
||||
translation_key="access_control",
|
||||
icon="mdi:block-helper",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
update=lambda router: router.api.get_block_device_enable_status,
|
||||
|
@ -58,7 +58,7 @@ ROUTER_SWITCH_TYPES = [
|
|||
),
|
||||
NetgearSwitchEntityDescription(
|
||||
key="traffic_meter",
|
||||
name="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,
|
||||
|
@ -66,7 +66,7 @@ ROUTER_SWITCH_TYPES = [
|
|||
),
|
||||
NetgearSwitchEntityDescription(
|
||||
key="parental_control",
|
||||
name="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,
|
||||
|
@ -74,7 +74,7 @@ ROUTER_SWITCH_TYPES = [
|
|||
),
|
||||
NetgearSwitchEntityDescription(
|
||||
key="qos",
|
||||
name="Quality of Service",
|
||||
translation_key="quality_of_service",
|
||||
icon="mdi:wifi-star",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
update=lambda router: router.api.get_qos_enable_status,
|
||||
|
@ -82,7 +82,7 @@ ROUTER_SWITCH_TYPES = [
|
|||
),
|
||||
NetgearSwitchEntityDescription(
|
||||
key="2g_guest_wifi",
|
||||
name="2.4G Guest Wifi",
|
||||
translation_key="2g_guest_wifi",
|
||||
icon="mdi:wifi",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
update=lambda router: router.api.get_2g_guest_access_enabled,
|
||||
|
@ -90,7 +90,7 @@ ROUTER_SWITCH_TYPES = [
|
|||
),
|
||||
NetgearSwitchEntityDescription(
|
||||
key="5g_guest_wifi",
|
||||
name="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,
|
||||
|
@ -98,7 +98,7 @@ ROUTER_SWITCH_TYPES = [
|
|||
),
|
||||
NetgearSwitchEntityDescription(
|
||||
key="smart_connect",
|
||||
name="Smart Connect",
|
||||
translation_key="smart_connect",
|
||||
icon="mdi:wifi",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
update=lambda router: router.api.get_smart_connect_enabled,
|
||||
|
|
Loading…
Reference in New Issue