mirror of
https://github.com/home-assistant/core.git
synced 2025-08-04 21:25:13 +02:00
Protect Huawei LTE against None ltedl/ulfreq (#54411)
Refs https://github.com/home-assistant/core/issues/54400
This commit is contained in:
@@ -193,11 +193,17 @@ SENSOR_META: dict[str | tuple[str, str], SensorMeta] = {
|
|||||||
),
|
),
|
||||||
(KEY_DEVICE_SIGNAL, "ltedlfreq"): SensorMeta(
|
(KEY_DEVICE_SIGNAL, "ltedlfreq"): SensorMeta(
|
||||||
name="Downlink frequency",
|
name="Downlink frequency",
|
||||||
formatter=lambda x: (round(int(x) / 10), FREQUENCY_MEGAHERTZ),
|
formatter=lambda x: (
|
||||||
|
round(int(x) / 10) if x is not None else None,
|
||||||
|
FREQUENCY_MEGAHERTZ,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
(KEY_DEVICE_SIGNAL, "lteulfreq"): SensorMeta(
|
(KEY_DEVICE_SIGNAL, "lteulfreq"): SensorMeta(
|
||||||
name="Uplink frequency",
|
name="Uplink frequency",
|
||||||
formatter=lambda x: (round(int(x) / 10), FREQUENCY_MEGAHERTZ),
|
formatter=lambda x: (
|
||||||
|
round(int(x) / 10) if x is not None else None,
|
||||||
|
FREQUENCY_MEGAHERTZ,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
KEY_MONITORING_CHECK_NOTIFICATIONS: SensorMeta(
|
KEY_MONITORING_CHECK_NOTIFICATIONS: SensorMeta(
|
||||||
exclude=re.compile(
|
exclude=re.compile(
|
||||||
|
Reference in New Issue
Block a user