mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Protect Huawei LTE against None ltedl/ulfreq (#54411)
Refs https://github.com/home-assistant/core/issues/54400
This commit is contained in:
parent
5a2bcd2763
commit
4e1e7a4a71
@ -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(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user