mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 09:17:53 +00:00
Add entity translations to Huawei LTE (#98631)
This commit is contained in:
parent
0f4aae4128
commit
7c85d84133
@ -104,7 +104,7 @@ CONNECTION_STATE_ATTRIBUTES = {
|
||||
class HuaweiLteMobileConnectionBinarySensor(HuaweiLteBaseBinarySensor):
|
||||
"""Huawei LTE mobile connection binary sensor."""
|
||||
|
||||
_attr_name: str = field(default="Mobile connection", init=False)
|
||||
_attr_translation_key: str = field(default="mobile_connection", init=False)
|
||||
_attr_entity_registry_enabled_default = True
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
@ -169,7 +169,7 @@ class HuaweiLteBaseWifiStatusBinarySensor(HuaweiLteBaseBinarySensor):
|
||||
class HuaweiLteWifiStatusBinarySensor(HuaweiLteBaseWifiStatusBinarySensor):
|
||||
"""Huawei LTE WiFi status binary sensor."""
|
||||
|
||||
_attr_name: str = field(default="WiFi status", init=False)
|
||||
_attr_translation_key: str = field(default="wifi_status", init=False)
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
"""Initialize identifiers."""
|
||||
@ -181,7 +181,7 @@ class HuaweiLteWifiStatusBinarySensor(HuaweiLteBaseWifiStatusBinarySensor):
|
||||
class HuaweiLteWifi24ghzStatusBinarySensor(HuaweiLteBaseWifiStatusBinarySensor):
|
||||
"""Huawei LTE 2.4GHz WiFi status binary sensor."""
|
||||
|
||||
_attr_name: str = field(default="2.4GHz WiFi status", init=False)
|
||||
_attr_translation_key: str = field(default="24ghz_wifi_status", init=False)
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
"""Initialize identifiers."""
|
||||
@ -193,7 +193,7 @@ class HuaweiLteWifi24ghzStatusBinarySensor(HuaweiLteBaseWifiStatusBinarySensor):
|
||||
class HuaweiLteWifi5ghzStatusBinarySensor(HuaweiLteBaseWifiStatusBinarySensor):
|
||||
"""Huawei LTE 5GHz WiFi status binary sensor."""
|
||||
|
||||
_attr_name: str = field(default="5GHz WiFi status", init=False)
|
||||
_attr_translation_key: str = field(default="5ghz_wifi_status", init=False)
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
"""Initialize identifiers."""
|
||||
@ -205,7 +205,7 @@ class HuaweiLteWifi5ghzStatusBinarySensor(HuaweiLteBaseWifiStatusBinarySensor):
|
||||
class HuaweiLteSmsStorageFullBinarySensor(HuaweiLteBaseBinarySensor):
|
||||
"""Huawei LTE SMS storage full binary sensor."""
|
||||
|
||||
_attr_name: str = field(default="SMS storage full", init=False)
|
||||
_attr_translation_key: str = field(default="sms_storage_full", init=False)
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
"""Initialize identifiers."""
|
||||
|
@ -137,7 +137,7 @@ SENSOR_META: dict[str, HuaweiSensorGroup] = {
|
||||
descriptions={
|
||||
"uptime": HuaweiSensorEntityDescription(
|
||||
key="uptime",
|
||||
name="Uptime",
|
||||
translation_key="uptime",
|
||||
icon="mdi:timer-outline",
|
||||
native_unit_of_measurement=UnitOfTime.SECONDS,
|
||||
device_class=SensorDeviceClass.DURATION,
|
||||
@ -145,14 +145,14 @@ SENSOR_META: dict[str, HuaweiSensorGroup] = {
|
||||
),
|
||||
"WanIPAddress": HuaweiSensorEntityDescription(
|
||||
key="WanIPAddress",
|
||||
name="WAN IP address",
|
||||
translation_key="wan_ip_address",
|
||||
icon="mdi:ip",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
entity_registry_enabled_default=True,
|
||||
),
|
||||
"WanIPv6Address": HuaweiSensorEntityDescription(
|
||||
key="WanIPv6Address",
|
||||
name="WAN IPv6 address",
|
||||
translation_key="wan_ipv6_address",
|
||||
icon="mdi:ip",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
@ -165,61 +165,61 @@ SENSOR_META: dict[str, HuaweiSensorGroup] = {
|
||||
descriptions={
|
||||
"arfcn": HuaweiSensorEntityDescription(
|
||||
key="arfcn",
|
||||
name="ARFCN",
|
||||
translation_key="arfcn",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
"band": HuaweiSensorEntityDescription(
|
||||
key="band",
|
||||
name="Band",
|
||||
translation_key="band",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
"bsic": HuaweiSensorEntityDescription(
|
||||
key="bsic",
|
||||
name="Base station identity code",
|
||||
translation_key="base_station_identity_code",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
"cell_id": HuaweiSensorEntityDescription(
|
||||
key="cell_id",
|
||||
name="Cell ID",
|
||||
translation_key="cell_id",
|
||||
icon="mdi:transmission-tower",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
"cqi0": HuaweiSensorEntityDescription(
|
||||
key="cqi0",
|
||||
name="CQI 0",
|
||||
translation_key="cqi0",
|
||||
icon="mdi:speedometer",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
"cqi1": HuaweiSensorEntityDescription(
|
||||
key="cqi1",
|
||||
name="CQI 1",
|
||||
translation_key="cqi1",
|
||||
icon="mdi:speedometer",
|
||||
),
|
||||
"dl_mcs": HuaweiSensorEntityDescription(
|
||||
key="dl_mcs",
|
||||
name="Downlink MCS",
|
||||
translation_key="downlink_mcs",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
"dlbandwidth": HuaweiSensorEntityDescription(
|
||||
key="dlbandwidth",
|
||||
name="Downlink bandwidth",
|
||||
translation_key="downlink_bandwidth",
|
||||
icon_fn=lambda x: bandwidth_icon((8, 15), x),
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
"dlfrequency": HuaweiSensorEntityDescription(
|
||||
key="dlfrequency",
|
||||
name="Downlink frequency",
|
||||
translation_key="downlink_frequency",
|
||||
device_class=SensorDeviceClass.FREQUENCY,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
"earfcn": HuaweiSensorEntityDescription(
|
||||
key="earfcn",
|
||||
name="EARFCN",
|
||||
translation_key="earfcn",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
"ecio": HuaweiSensorEntityDescription(
|
||||
key="ecio",
|
||||
name="EC/IO",
|
||||
translation_key="ecio",
|
||||
device_class=SensorDeviceClass.SIGNAL_STRENGTH,
|
||||
# https://wiki.teltonika.lt/view/EC/IO
|
||||
icon_fn=lambda x: signal_icon((-20, -10, -6), x),
|
||||
@ -228,18 +228,18 @@ SENSOR_META: dict[str, HuaweiSensorGroup] = {
|
||||
),
|
||||
"enodeb_id": HuaweiSensorEntityDescription(
|
||||
key="enodeb_id",
|
||||
name="eNodeB ID",
|
||||
translation_key="enodeb_id",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
"lac": HuaweiSensorEntityDescription(
|
||||
key="lac",
|
||||
name="LAC",
|
||||
translation_key="lac",
|
||||
icon="mdi:map-marker",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
"ltedlfreq": HuaweiSensorEntityDescription(
|
||||
key="ltedlfreq",
|
||||
name="LTE downlink frequency",
|
||||
translation_key="lte_downlink_frequency",
|
||||
format_fn=format_freq_mhz,
|
||||
suggested_display_precision=0,
|
||||
device_class=SensorDeviceClass.FREQUENCY,
|
||||
@ -247,7 +247,7 @@ SENSOR_META: dict[str, HuaweiSensorGroup] = {
|
||||
),
|
||||
"lteulfreq": HuaweiSensorEntityDescription(
|
||||
key="lteulfreq",
|
||||
name="LTE uplink frequency",
|
||||
translation_key="lte_uplink_frequency",
|
||||
format_fn=format_freq_mhz,
|
||||
suggested_display_precision=0,
|
||||
device_class=SensorDeviceClass.FREQUENCY,
|
||||
@ -255,7 +255,7 @@ SENSOR_META: dict[str, HuaweiSensorGroup] = {
|
||||
),
|
||||
"mode": HuaweiSensorEntityDescription(
|
||||
key="mode",
|
||||
name="Mode",
|
||||
translation_key="mode",
|
||||
format_fn=lambda x: (
|
||||
{"0": "2G", "2": "3G", "7": "4G"}.get(x),
|
||||
None,
|
||||
@ -271,29 +271,29 @@ SENSOR_META: dict[str, HuaweiSensorGroup] = {
|
||||
),
|
||||
"pci": HuaweiSensorEntityDescription(
|
||||
key="pci",
|
||||
name="PCI",
|
||||
translation_key="pci",
|
||||
icon="mdi:transmission-tower",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
"plmn": HuaweiSensorEntityDescription(
|
||||
key="plmn",
|
||||
name="PLMN",
|
||||
translation_key="plmn",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
"rac": HuaweiSensorEntityDescription(
|
||||
key="rac",
|
||||
name="RAC",
|
||||
translation_key="rac",
|
||||
icon="mdi:map-marker",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
"rrc_status": HuaweiSensorEntityDescription(
|
||||
key="rrc_status",
|
||||
name="RRC status",
|
||||
translation_key="rrc_status",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
"rscp": HuaweiSensorEntityDescription(
|
||||
key="rscp",
|
||||
name="RSCP",
|
||||
translation_key="rscp",
|
||||
device_class=SensorDeviceClass.SIGNAL_STRENGTH,
|
||||
# https://wiki.teltonika.lt/view/RSCP
|
||||
icon_fn=lambda x: signal_icon((-95, -85, -75), x),
|
||||
@ -302,7 +302,7 @@ SENSOR_META: dict[str, HuaweiSensorGroup] = {
|
||||
),
|
||||
"rsrp": HuaweiSensorEntityDescription(
|
||||
key="rsrp",
|
||||
name="RSRP",
|
||||
translation_key="rsrp",
|
||||
device_class=SensorDeviceClass.SIGNAL_STRENGTH,
|
||||
# http://www.lte-anbieter.info/technik/rsrp.php
|
||||
icon_fn=lambda x: signal_icon((-110, -95, -80), x),
|
||||
@ -312,7 +312,7 @@ SENSOR_META: dict[str, HuaweiSensorGroup] = {
|
||||
),
|
||||
"rsrq": HuaweiSensorEntityDescription(
|
||||
key="rsrq",
|
||||
name="RSRQ",
|
||||
translation_key="rsrq",
|
||||
device_class=SensorDeviceClass.SIGNAL_STRENGTH,
|
||||
# http://www.lte-anbieter.info/technik/rsrq.php
|
||||
icon_fn=lambda x: signal_icon((-11, -8, -5), x),
|
||||
@ -322,7 +322,7 @@ SENSOR_META: dict[str, HuaweiSensorGroup] = {
|
||||
),
|
||||
"rssi": HuaweiSensorEntityDescription(
|
||||
key="rssi",
|
||||
name="RSSI",
|
||||
translation_key="rssi",
|
||||
device_class=SensorDeviceClass.SIGNAL_STRENGTH,
|
||||
# https://eyesaas.com/wi-fi-signal-strength/
|
||||
icon_fn=lambda x: signal_icon((-80, -70, -60), x),
|
||||
@ -332,7 +332,7 @@ SENSOR_META: dict[str, HuaweiSensorGroup] = {
|
||||
),
|
||||
"sinr": HuaweiSensorEntityDescription(
|
||||
key="sinr",
|
||||
name="SINR",
|
||||
translation_key="sinr",
|
||||
device_class=SensorDeviceClass.SIGNAL_STRENGTH,
|
||||
# http://www.lte-anbieter.info/technik/sinr.php
|
||||
icon_fn=lambda x: signal_icon((0, 5, 10), x),
|
||||
@ -342,23 +342,23 @@ SENSOR_META: dict[str, HuaweiSensorGroup] = {
|
||||
),
|
||||
"tac": HuaweiSensorEntityDescription(
|
||||
key="tac",
|
||||
name="TAC",
|
||||
translation_key="tac",
|
||||
icon="mdi:map-marker",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
"tdd": HuaweiSensorEntityDescription(
|
||||
key="tdd",
|
||||
name="TDD",
|
||||
translation_key="tdd",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
"transmode": HuaweiSensorEntityDescription(
|
||||
key="transmode",
|
||||
name="Transmission mode",
|
||||
translation_key="transmission_mode",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
"txpower": HuaweiSensorEntityDescription(
|
||||
key="txpower",
|
||||
name="Transmit power",
|
||||
translation_key="transmit_power",
|
||||
# The value we get from the API tends to consist of several, e.g.
|
||||
# PPusch:15dBm PPucch:2dBm PSrs:42dBm PPrach:1dBm
|
||||
# Present as SIGNAL_STRENGTH only if it was parsed to a number.
|
||||
@ -372,18 +372,18 @@ SENSOR_META: dict[str, HuaweiSensorGroup] = {
|
||||
),
|
||||
"ul_mcs": HuaweiSensorEntityDescription(
|
||||
key="ul_mcs",
|
||||
name="Uplink MCS",
|
||||
translation_key="uplink_mcs",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
"ulbandwidth": HuaweiSensorEntityDescription(
|
||||
key="ulbandwidth",
|
||||
name="Uplink bandwidth",
|
||||
translation_key="uplink_bandwidth",
|
||||
icon_fn=lambda x: bandwidth_icon((8, 15), x),
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
"ulfrequency": HuaweiSensorEntityDescription(
|
||||
key="ulfrequency",
|
||||
name="Uplink frequency",
|
||||
translation_key="uplink_frequency",
|
||||
device_class=SensorDeviceClass.FREQUENCY,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
@ -399,7 +399,9 @@ SENSOR_META: dict[str, HuaweiSensorGroup] = {
|
||||
),
|
||||
descriptions={
|
||||
"UnreadMessage": HuaweiSensorEntityDescription(
|
||||
key="UnreadMessage", name="SMS unread", icon="mdi:email-arrow-left"
|
||||
key="UnreadMessage",
|
||||
translation_key="sms_unread",
|
||||
icon="mdi:email-arrow-left",
|
||||
),
|
||||
},
|
||||
),
|
||||
@ -410,7 +412,7 @@ SENSOR_META: dict[str, HuaweiSensorGroup] = {
|
||||
descriptions={
|
||||
"CurrentDayUsed": HuaweiSensorEntityDescription(
|
||||
key="CurrentDayUsed",
|
||||
name="Current day transfer",
|
||||
translation_key="current_day_transfer",
|
||||
native_unit_of_measurement=UnitOfInformation.BYTES,
|
||||
device_class=SensorDeviceClass.DATA_SIZE,
|
||||
icon="mdi:arrow-up-down-bold",
|
||||
@ -420,7 +422,7 @@ SENSOR_META: dict[str, HuaweiSensorGroup] = {
|
||||
),
|
||||
"CurrentMonthDownload": HuaweiSensorEntityDescription(
|
||||
key="CurrentMonthDownload",
|
||||
name="Current month download",
|
||||
translation_key="current_month_download",
|
||||
native_unit_of_measurement=UnitOfInformation.BYTES,
|
||||
device_class=SensorDeviceClass.DATA_SIZE,
|
||||
icon="mdi:download",
|
||||
@ -430,7 +432,7 @@ SENSOR_META: dict[str, HuaweiSensorGroup] = {
|
||||
),
|
||||
"CurrentMonthUpload": HuaweiSensorEntityDescription(
|
||||
key="CurrentMonthUpload",
|
||||
name="Current month upload",
|
||||
translation_key="current_month_upload",
|
||||
native_unit_of_measurement=UnitOfInformation.BYTES,
|
||||
device_class=SensorDeviceClass.DATA_SIZE,
|
||||
icon="mdi:upload",
|
||||
@ -448,7 +450,6 @@ SENSOR_META: dict[str, HuaweiSensorGroup] = {
|
||||
descriptions={
|
||||
"BatteryPercent": HuaweiSensorEntityDescription(
|
||||
key="BatteryPercent",
|
||||
name="Battery",
|
||||
device_class=SensorDeviceClass.BATTERY,
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
@ -456,32 +457,32 @@ SENSOR_META: dict[str, HuaweiSensorGroup] = {
|
||||
),
|
||||
"CurrentWifiUser": HuaweiSensorEntityDescription(
|
||||
key="CurrentWifiUser",
|
||||
name="WiFi clients connected",
|
||||
translation_key="wifi_clients_connected",
|
||||
icon="mdi:wifi",
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
"PrimaryDns": HuaweiSensorEntityDescription(
|
||||
key="PrimaryDns",
|
||||
name="Primary DNS server",
|
||||
translation_key="primary_dns_server",
|
||||
icon="mdi:ip",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
"PrimaryIPv6Dns": HuaweiSensorEntityDescription(
|
||||
key="PrimaryIPv6Dns",
|
||||
name="Primary IPv6 DNS server",
|
||||
translation_key="primary_ipv6_dns_server",
|
||||
icon="mdi:ip",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
"SecondaryDns": HuaweiSensorEntityDescription(
|
||||
key="SecondaryDns",
|
||||
name="Secondary DNS server",
|
||||
translation_key="secondary_dns_server",
|
||||
icon="mdi:ip",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
"SecondaryIPv6Dns": HuaweiSensorEntityDescription(
|
||||
key="SecondaryIPv6Dns",
|
||||
name="Secondary IPv6 DNS server",
|
||||
translation_key="secondary_ipv6_dns_server",
|
||||
icon="mdi:ip",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
@ -492,14 +493,14 @@ SENSOR_META: dict[str, HuaweiSensorGroup] = {
|
||||
descriptions={
|
||||
"CurrentConnectTime": HuaweiSensorEntityDescription(
|
||||
key="CurrentConnectTime",
|
||||
name="Current connection duration",
|
||||
translation_key="current_connection_duration",
|
||||
native_unit_of_measurement=UnitOfTime.SECONDS,
|
||||
device_class=SensorDeviceClass.DURATION,
|
||||
icon="mdi:timer-outline",
|
||||
),
|
||||
"CurrentDownload": HuaweiSensorEntityDescription(
|
||||
key="CurrentDownload",
|
||||
name="Current connection download",
|
||||
translation_key="current_connection_download",
|
||||
native_unit_of_measurement=UnitOfInformation.BYTES,
|
||||
device_class=SensorDeviceClass.DATA_SIZE,
|
||||
icon="mdi:download",
|
||||
@ -507,7 +508,7 @@ SENSOR_META: dict[str, HuaweiSensorGroup] = {
|
||||
),
|
||||
"CurrentDownloadRate": HuaweiSensorEntityDescription(
|
||||
key="CurrentDownloadRate",
|
||||
name="Current download rate",
|
||||
translation_key="current_download_rate",
|
||||
native_unit_of_measurement=UnitOfDataRate.BYTES_PER_SECOND,
|
||||
device_class=SensorDeviceClass.DATA_RATE,
|
||||
icon="mdi:download",
|
||||
@ -515,7 +516,7 @@ SENSOR_META: dict[str, HuaweiSensorGroup] = {
|
||||
),
|
||||
"CurrentUpload": HuaweiSensorEntityDescription(
|
||||
key="CurrentUpload",
|
||||
name="Current connection upload",
|
||||
translation_key="current_connection_upload",
|
||||
native_unit_of_measurement=UnitOfInformation.BYTES,
|
||||
device_class=SensorDeviceClass.DATA_SIZE,
|
||||
icon="mdi:upload",
|
||||
@ -523,7 +524,7 @@ SENSOR_META: dict[str, HuaweiSensorGroup] = {
|
||||
),
|
||||
"CurrentUploadRate": HuaweiSensorEntityDescription(
|
||||
key="CurrentUploadRate",
|
||||
name="Current upload rate",
|
||||
translation_key="current_upload_rate",
|
||||
native_unit_of_measurement=UnitOfDataRate.BYTES_PER_SECOND,
|
||||
device_class=SensorDeviceClass.DATA_RATE,
|
||||
icon="mdi:upload",
|
||||
@ -531,7 +532,7 @@ SENSOR_META: dict[str, HuaweiSensorGroup] = {
|
||||
),
|
||||
"TotalConnectTime": HuaweiSensorEntityDescription(
|
||||
key="TotalConnectTime",
|
||||
name="Total connected duration",
|
||||
translation_key="total_connected_duration",
|
||||
native_unit_of_measurement=UnitOfTime.SECONDS,
|
||||
device_class=SensorDeviceClass.DURATION,
|
||||
icon="mdi:timer-outline",
|
||||
@ -539,7 +540,7 @@ SENSOR_META: dict[str, HuaweiSensorGroup] = {
|
||||
),
|
||||
"TotalDownload": HuaweiSensorEntityDescription(
|
||||
key="TotalDownload",
|
||||
name="Total download",
|
||||
translation_key="total_download",
|
||||
native_unit_of_measurement=UnitOfInformation.BYTES,
|
||||
device_class=SensorDeviceClass.DATA_SIZE,
|
||||
icon="mdi:download",
|
||||
@ -547,7 +548,7 @@ SENSOR_META: dict[str, HuaweiSensorGroup] = {
|
||||
),
|
||||
"TotalUpload": HuaweiSensorEntityDescription(
|
||||
key="TotalUpload",
|
||||
name="Total upload",
|
||||
translation_key="total_upload",
|
||||
native_unit_of_measurement=UnitOfInformation.BYTES,
|
||||
device_class=SensorDeviceClass.DATA_SIZE,
|
||||
icon="mdi:upload",
|
||||
@ -563,17 +564,17 @@ SENSOR_META: dict[str, HuaweiSensorGroup] = {
|
||||
descriptions={
|
||||
"FullName": HuaweiSensorEntityDescription(
|
||||
key="FullName",
|
||||
name="Operator name",
|
||||
translation_key="operator_name",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
"Numeric": HuaweiSensorEntityDescription(
|
||||
key="Numeric",
|
||||
name="Operator code",
|
||||
translation_key="operator_code",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
"State": HuaweiSensorEntityDescription(
|
||||
key="State",
|
||||
name="Operator search mode",
|
||||
translation_key="operator_search_mode",
|
||||
format_fn=lambda x: (
|
||||
{"0": "Auto", "1": "Manual"}.get(x),
|
||||
None,
|
||||
@ -587,7 +588,7 @@ SENSOR_META: dict[str, HuaweiSensorGroup] = {
|
||||
descriptions={
|
||||
"NetworkMode": HuaweiSensorEntityDescription(
|
||||
key="NetworkMode",
|
||||
name="Preferred mode",
|
||||
translation_key="preferred_mode",
|
||||
format_fn=lambda x: (
|
||||
{
|
||||
NetworkModeEnum.MODE_AUTO.value: "4G/3G/2G",
|
||||
@ -611,62 +612,62 @@ SENSOR_META: dict[str, HuaweiSensorGroup] = {
|
||||
descriptions={
|
||||
"LocalDeleted": HuaweiSensorEntityDescription(
|
||||
key="LocalDeleted",
|
||||
name="SMS deleted (device)",
|
||||
translation_key="sms_deleted_device",
|
||||
icon="mdi:email-minus",
|
||||
),
|
||||
"LocalDraft": HuaweiSensorEntityDescription(
|
||||
key="LocalDraft",
|
||||
name="SMS drafts (device)",
|
||||
translation_key="sms_drafts_device",
|
||||
icon="mdi:email-arrow-right-outline",
|
||||
),
|
||||
"LocalInbox": HuaweiSensorEntityDescription(
|
||||
key="LocalInbox",
|
||||
name="SMS inbox (device)",
|
||||
translation_key="sms_inbox_device",
|
||||
icon="mdi:email",
|
||||
),
|
||||
"LocalMax": HuaweiSensorEntityDescription(
|
||||
key="LocalMax",
|
||||
name="SMS capacity (device)",
|
||||
translation_key="sms_capacity_device",
|
||||
icon="mdi:email",
|
||||
),
|
||||
"LocalOutbox": HuaweiSensorEntityDescription(
|
||||
key="LocalOutbox",
|
||||
name="SMS outbox (device)",
|
||||
translation_key="sms_outbox_device",
|
||||
icon="mdi:email-arrow-right",
|
||||
),
|
||||
"LocalUnread": HuaweiSensorEntityDescription(
|
||||
key="LocalUnread",
|
||||
name="SMS unread (device)",
|
||||
translation_key="sms_unread_device",
|
||||
icon="mdi:email-arrow-left",
|
||||
),
|
||||
"SimDraft": HuaweiSensorEntityDescription(
|
||||
key="SimDraft",
|
||||
name="SMS drafts (SIM)",
|
||||
translation_key="sms_drafts_sim",
|
||||
icon="mdi:email-arrow-right-outline",
|
||||
),
|
||||
"SimInbox": HuaweiSensorEntityDescription(
|
||||
key="SimInbox",
|
||||
name="SMS inbox (SIM)",
|
||||
translation_key="sms_inbox_sim",
|
||||
icon="mdi:email",
|
||||
),
|
||||
"SimMax": HuaweiSensorEntityDescription(
|
||||
key="SimMax",
|
||||
name="SMS capacity (SIM)",
|
||||
translation_key="sms_capacity_sim",
|
||||
icon="mdi:email",
|
||||
),
|
||||
"SimOutbox": HuaweiSensorEntityDescription(
|
||||
key="SimOutbox",
|
||||
name="SMS outbox (SIM)",
|
||||
translation_key="sms_outbox_sim",
|
||||
icon="mdi:email-arrow-right",
|
||||
),
|
||||
"SimUnread": HuaweiSensorEntityDescription(
|
||||
key="SimUnread",
|
||||
name="SMS unread (SIM)",
|
||||
translation_key="sms_unread_sim",
|
||||
icon="mdi:email-arrow-left",
|
||||
),
|
||||
"SimUsed": HuaweiSensorEntityDescription(
|
||||
key="SimUsed",
|
||||
name="SMS messages (SIM)",
|
||||
translation_key="sms_messages_sim",
|
||||
icon="mdi:email-arrow-left",
|
||||
),
|
||||
},
|
||||
|
@ -49,6 +49,236 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"entity": {
|
||||
"binary_sensor": {
|
||||
"mobile_connection": {
|
||||
"name": "Mobile connection"
|
||||
},
|
||||
"wifi_status": {
|
||||
"name": "Wi-Fi status"
|
||||
},
|
||||
"24ghz_wifi_status": {
|
||||
"name": "2.4GHz Wi-Fi status"
|
||||
},
|
||||
"5ghz_wifi_status": {
|
||||
"name": "5GHz Wi-Fi status"
|
||||
},
|
||||
"sms_storage_full": {
|
||||
"name": "SMS storage full"
|
||||
}
|
||||
},
|
||||
"sensor": {
|
||||
"uptime": {
|
||||
"name": "Uptime"
|
||||
},
|
||||
"wan_ip_address": {
|
||||
"name": "WAN IP address"
|
||||
},
|
||||
"wan_ipv6_address": {
|
||||
"name": "WAN IPv6 address"
|
||||
},
|
||||
"arfcn": {
|
||||
"name": "ARFCN"
|
||||
},
|
||||
"band": {
|
||||
"name": "Band"
|
||||
},
|
||||
"base_station_identity_code": {
|
||||
"name": "Base station identity code"
|
||||
},
|
||||
"cell_id": {
|
||||
"name": "Cell ID"
|
||||
},
|
||||
"cqi0": {
|
||||
"name": "CQI 0"
|
||||
},
|
||||
"cqi1": {
|
||||
"name": "CQI 1"
|
||||
},
|
||||
"downlink_mcs": {
|
||||
"name": "Downlink MCS"
|
||||
},
|
||||
"downlink_bandwidth": {
|
||||
"name": "Downlink bandwidth"
|
||||
},
|
||||
"downlink_frequency": {
|
||||
"name": "Downlink frequency"
|
||||
},
|
||||
"earfcn": {
|
||||
"name": "EARFCN"
|
||||
},
|
||||
"ecio": {
|
||||
"name": "EC/IO"
|
||||
},
|
||||
"enodeb_id": {
|
||||
"name": "eNodeB ID"
|
||||
},
|
||||
"lac": {
|
||||
"name": "LAC"
|
||||
},
|
||||
"lte_downlink_frequency": {
|
||||
"name": "LTE downlink frequency"
|
||||
},
|
||||
"lte_uplink_frequency": {
|
||||
"name": "LTE uplink frequency"
|
||||
},
|
||||
"pci": {
|
||||
"name": "PCI"
|
||||
},
|
||||
"plmn": {
|
||||
"name": "PLMN"
|
||||
},
|
||||
"rac": {
|
||||
"name": "RAC"
|
||||
},
|
||||
"rrc_status": {
|
||||
"name": "RRC status"
|
||||
},
|
||||
"rscp": {
|
||||
"name": "RSCP"
|
||||
},
|
||||
"rsrp": {
|
||||
"name": "RSRP"
|
||||
},
|
||||
"rsrq": {
|
||||
"name": "RSRQ"
|
||||
},
|
||||
"rssi": {
|
||||
"name": "RSSI"
|
||||
},
|
||||
"sinr": {
|
||||
"name": "SINR"
|
||||
},
|
||||
"tac": {
|
||||
"name": "TAC"
|
||||
},
|
||||
"tdd": {
|
||||
"name": "TDD"
|
||||
},
|
||||
"transmission_mode": {
|
||||
"name": "Transmission mode"
|
||||
},
|
||||
"transmit_power": {
|
||||
"name": "Transmit power"
|
||||
},
|
||||
"uplink_mcs": {
|
||||
"name": "Uplink MCS"
|
||||
},
|
||||
"uplink_bandwidth": {
|
||||
"name": "Uplink bandwidth"
|
||||
},
|
||||
"uplink_frequency": {
|
||||
"name": "Uplink frequency"
|
||||
},
|
||||
"sms_unread": {
|
||||
"name": "SMS unread"
|
||||
},
|
||||
"current_day_transfer": {
|
||||
"name": "Current day transfer"
|
||||
},
|
||||
"current_month_download": {
|
||||
"name": "Current month download"
|
||||
},
|
||||
"current_month_upload": {
|
||||
"name": "Current month upload"
|
||||
},
|
||||
"wifi_clients_connected": {
|
||||
"name": "Wi-Fi clients connected"
|
||||
},
|
||||
"primary_dns_server": {
|
||||
"name": "Primary DNS server"
|
||||
},
|
||||
"primary_ipv6_dns_server": {
|
||||
"name": "Primary IPv6 DNS server"
|
||||
},
|
||||
"secondary_dns_server": {
|
||||
"name": "Secondary DNS server"
|
||||
},
|
||||
"secondary_ipv6_dns_server": {
|
||||
"name": "Secondary IPv6 DNS server"
|
||||
},
|
||||
"current_connection_duration": {
|
||||
"name": "Current connection duration"
|
||||
},
|
||||
"current_connection_download": {
|
||||
"name": "Current connection download"
|
||||
},
|
||||
"current_download_rate": {
|
||||
"name": "Current download rate"
|
||||
},
|
||||
"current_connection_upload": {
|
||||
"name": "Current connection upload"
|
||||
},
|
||||
"current_upload_rate": {
|
||||
"name": "Current upload rate"
|
||||
},
|
||||
"total_connected_duration": {
|
||||
"name": "Total connected duration"
|
||||
},
|
||||
"total_download": {
|
||||
"name": "Total download"
|
||||
},
|
||||
"total_upload": {
|
||||
"name": "Total upload"
|
||||
},
|
||||
"operator_name": {
|
||||
"name": "Operator name"
|
||||
},
|
||||
"operator_code": {
|
||||
"name": "Operator code"
|
||||
},
|
||||
"operator_search_mode": {
|
||||
"name": "Operator search mode"
|
||||
},
|
||||
"preferred_mode": {
|
||||
"name": "Preferred mode"
|
||||
},
|
||||
"sms_deleted_device": {
|
||||
"name": "SMS deleted (device)"
|
||||
},
|
||||
"sms_drafts_device": {
|
||||
"name": "SMS drafts (device)"
|
||||
},
|
||||
"sms_inbox_device": {
|
||||
"name": "SMS inbox (device)"
|
||||
},
|
||||
"sms_capacity_device": {
|
||||
"name": "SMS capacity (device)"
|
||||
},
|
||||
"sms_outbox_device": {
|
||||
"name": "SMS outbox (device)"
|
||||
},
|
||||
"sms_unread_device": {
|
||||
"name": "SMS unread (device)"
|
||||
},
|
||||
"sms_drafts_sim": {
|
||||
"name": "SMS drafts (SIM)"
|
||||
},
|
||||
"sms_inbox_sim": {
|
||||
"name": "SMS inbox (SIM)"
|
||||
},
|
||||
"sms_capacity_sim": {
|
||||
"name": "SMS capacity (SIM)"
|
||||
},
|
||||
"sms_outbox_sim": {
|
||||
"name": "SMS outbox (SIM)"
|
||||
},
|
||||
"sms_unread_sim": {
|
||||
"name": "SMS unread (SIM)"
|
||||
},
|
||||
"sms_messages_sim": {
|
||||
"name": "SMS messages (SIM)"
|
||||
}
|
||||
},
|
||||
"switch": {
|
||||
"mobile_data": {
|
||||
"name": "Mobile data"
|
||||
},
|
||||
"wifi_guest_network": {
|
||||
"name": "Wi-Fi guest network"
|
||||
}
|
||||
}
|
||||
},
|
||||
"services": {
|
||||
"clear_traffic_statistics": {
|
||||
"name": "Clear traffic statistics",
|
||||
|
@ -92,7 +92,7 @@ class HuaweiLteBaseSwitch(HuaweiLteBaseEntityWithDevice, SwitchEntity):
|
||||
class HuaweiLteMobileDataSwitch(HuaweiLteBaseSwitch):
|
||||
"""Huawei LTE mobile data switch device."""
|
||||
|
||||
_attr_name: str = field(default="Mobile data", init=False)
|
||||
_attr_translation_key: str = field(default="mobile_data", init=False)
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
"""Initialize identifiers."""
|
||||
@ -124,7 +124,7 @@ class HuaweiLteMobileDataSwitch(HuaweiLteBaseSwitch):
|
||||
class HuaweiLteWifiGuestNetworkSwitch(HuaweiLteBaseSwitch):
|
||||
"""Huawei LTE WiFi guest network switch device."""
|
||||
|
||||
_attr_name: str = field(default="WiFi guest network", init=False)
|
||||
_attr_translation_key: str = field(default="wifi_guest_network", init=False)
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
"""Initialize identifiers."""
|
||||
|
@ -16,7 +16,7 @@ from homeassistant.helpers.entity_registry import EntityRegistry
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
|
||||
SWITCH_WIFI_GUEST_NETWORK = "switch.lte_wifi_guest_network"
|
||||
SWITCH_WIFI_GUEST_NETWORK = "switch.lte_wi_fi_guest_network"
|
||||
|
||||
|
||||
def magic_client(multi_basic_settings_value: dict) -> MagicMock:
|
||||
|
Loading…
x
Reference in New Issue
Block a user