diff --git a/.gitignore b/.gitignore index 0b8ee4c7b5338..77b5cc6933b47 100644 --- a/.gitignore +++ b/.gitignore @@ -92,6 +92,7 @@ pip-selfcheck.json venv .venv Pipfile* +uv.lock share/* /Scripts/ diff --git a/homeassistant/components/huawei_lte/sensor.py b/homeassistant/components/huawei_lte/sensor.py index 81f1e71c1324f..8f31ffd593b30 100644 --- a/homeassistant/components/huawei_lte/sensor.py +++ b/homeassistant/components/huawei_lte/sensor.py @@ -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, ), @@ -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, @@ -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( @@ -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, @@ -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, @@ -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, @@ -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( @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, ),