Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ pip-selfcheck.json
venv
.venv
Pipfile*
uv.lock
share/*
/Scripts/

Expand Down
38 changes: 22 additions & 16 deletions homeassistant/components/huawei_lte/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ class HuaweiSensorEntityDescription(SensorEntityDescription):
"dlbandwidth": HuaweiSensorEntityDescription(
key="dlbandwidth",
translation_key="downlink_bandwidth",
# https://en.wikipedia.org/wiki/LTE_frequency_bands, arbitrary
icon_fn=lambda x: bandwidth_icon((8, 15), x),
entity_category=EntityCategory.DIAGNOSTIC,
),
Expand All @@ -216,7 +217,7 @@ class HuaweiSensorEntityDescription(SensorEntityDescription):
key="ecio",
translation_key="ecio",
device_class=SensorDeviceClass.SIGNAL_STRENGTH,
# https://wiki.teltonika.lt/view/EC/IO
# https://wiki.teltonika-networks.com/view/EC/IO
icon_fn=lambda x: signal_icon((-20, -10, -6), x),
state_class=SensorStateClass.MEASUREMENT,
entity_category=EntityCategory.DIAGNOSTIC,
Expand Down Expand Up @@ -291,8 +292,8 @@ class HuaweiSensorEntityDescription(SensorEntityDescription):
"nrdlbandwidth": HuaweiSensorEntityDescription(
key="nrdlbandwidth",
translation_key="nrdlbandwidth",
# Could add icon_fn like we have for dlbandwidth,
# if we find a good source what to use as 5G thresholds.
# https://en.wikipedia.org/wiki/5G_NR_frequency_bands, arbitrary
icon_fn=lambda x: bandwidth_icon((33, 66), x),
entity_category=EntityCategory.DIAGNOSTIC,
),
"nrdlmcs": HuaweiSensorEntityDescription(
Expand All @@ -314,7 +315,8 @@ class HuaweiSensorEntityDescription(SensorEntityDescription):
key="nrrsrp",
translation_key="nrrsrp",
device_class=SensorDeviceClass.SIGNAL_STRENGTH,
# Could add icon_fn as in rsrp, source for 5G thresholds?
# https://wiki.teltonika-networks.com/view/RSRP_and_RSRQ
icon_fn=lambda x: signal_icon((-100, -90, -80), x),
state_class=SensorStateClass.MEASUREMENT,
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=True,
Expand All @@ -323,7 +325,8 @@ class HuaweiSensorEntityDescription(SensorEntityDescription):
key="nrrsrq",
translation_key="nrrsrq",
device_class=SensorDeviceClass.SIGNAL_STRENGTH,
# Could add icon_fn as in rsrq, source for 5G thresholds?
# https://wiki.teltonika-networks.com/view/RSRP_and_RSRQ
icon_fn=lambda x: signal_icon((-20, -15, -10), x),
state_class=SensorStateClass.MEASUREMENT,
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=True,
Expand All @@ -332,7 +335,8 @@ class HuaweiSensorEntityDescription(SensorEntityDescription):
key="nrsinr",
translation_key="nrsinr",
device_class=SensorDeviceClass.SIGNAL_STRENGTH,
# Could add icon_fn as in sinr, source for thresholds?
# https://wiki.teltonika-networks.com/view/SINR
icon_fn=lambda x: signal_icon((0, 13, 20), x),
state_class=SensorStateClass.MEASUREMENT,
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=True,
Expand All @@ -354,7 +358,8 @@ class HuaweiSensorEntityDescription(SensorEntityDescription):
"nrulbandwidth": HuaweiSensorEntityDescription(
key="nrulbandwidth",
translation_key="nrulbandwidth",
# Could add icon_fn as in ulbandwidth, source for 5G thresholds?
# https://en.wikipedia.org/wiki/5G_NR_frequency_bands, arbitrary
icon_fn=lambda x: bandwidth_icon((33, 66), x),
entity_category=EntityCategory.DIAGNOSTIC,
),
"nrulmcs": HuaweiSensorEntityDescription(
Expand Down Expand Up @@ -386,7 +391,7 @@ class HuaweiSensorEntityDescription(SensorEntityDescription):
key="rscp",
translation_key="rscp",
device_class=SensorDeviceClass.SIGNAL_STRENGTH,
# https://wiki.teltonika.lt/view/RSCP
# https://wiki.teltonika-networks.com/view/RSCP
icon_fn=lambda x: signal_icon((-95, -85, -75), x),
state_class=SensorStateClass.MEASUREMENT,
entity_category=EntityCategory.DIAGNOSTIC,
Expand All @@ -395,8 +400,8 @@ class HuaweiSensorEntityDescription(SensorEntityDescription):
key="rsrp",
translation_key="rsrp",
device_class=SensorDeviceClass.SIGNAL_STRENGTH,
# http://www.lte-anbieter.info/technik/rsrp.php # codespell:ignore technik
icon_fn=lambda x: signal_icon((-110, -95, -80), x),
# https://wiki.teltonika-networks.com/view/RSRP_and_RSRQ
icon_fn=lambda x: signal_icon((-100, -90, -80), x),
state_class=SensorStateClass.MEASUREMENT,
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=True,
Expand All @@ -405,8 +410,8 @@ class HuaweiSensorEntityDescription(SensorEntityDescription):
key="rsrq",
translation_key="rsrq",
device_class=SensorDeviceClass.SIGNAL_STRENGTH,
# http://www.lte-anbieter.info/technik/rsrq.php # codespell:ignore technik
icon_fn=lambda x: signal_icon((-11, -8, -5), x),
# https://wiki.teltonika-networks.com/view/RSRP_and_RSRQ
icon_fn=lambda x: signal_icon((-20, -15, -10), x),
state_class=SensorStateClass.MEASUREMENT,
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=True,
Expand All @@ -415,8 +420,8 @@ class HuaweiSensorEntityDescription(SensorEntityDescription):
key="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),
# https://wiki.teltonika-networks.com/view/RSSI
icon_fn=lambda x: signal_icon((-95, -85, -75), x),
state_class=SensorStateClass.MEASUREMENT,
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=True,
Expand All @@ -436,8 +441,8 @@ class HuaweiSensorEntityDescription(SensorEntityDescription):
key="sinr",
translation_key="sinr",
device_class=SensorDeviceClass.SIGNAL_STRENGTH,
# http://www.lte-anbieter.info/technik/sinr.php # codespell:ignore technik
icon_fn=lambda x: signal_icon((0, 5, 10), x),
# https://wiki.teltonika-networks.com/view/SINR
icon_fn=lambda x: signal_icon((0, 13, 20), x),
state_class=SensorStateClass.MEASUREMENT,
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=True,
Expand Down Expand Up @@ -479,6 +484,7 @@ class HuaweiSensorEntityDescription(SensorEntityDescription):
"ulbandwidth": HuaweiSensorEntityDescription(
key="ulbandwidth",
translation_key="uplink_bandwidth",
# https://en.wikipedia.org/wiki/LTE_frequency_bands, arbitrary
icon_fn=lambda x: bandwidth_icon((8, 15), x),
entity_category=EntityCategory.DIAGNOSTIC,
),
Expand Down
Loading