mirror of
https://github.com/home-assistant/core.git
synced 2025-04-26 10:17:51 +00:00
Ignore myuplink sensors without a description that provide non-numeric values (#115525)
Ignore sensors without a description that provide non-numeric values Co-authored-by: Jan-Philipp Benecke <jan-philipp@bnck.me>
This commit is contained in:
parent
b39d7b39e1
commit
c52fabcf77
@ -160,6 +160,11 @@ async def async_setup_entry(
|
|||||||
if find_matching_platform(device_point) == Platform.SENSOR:
|
if find_matching_platform(device_point) == Platform.SENSOR:
|
||||||
description = get_description(device_point)
|
description = get_description(device_point)
|
||||||
entity_class = MyUplinkDevicePointSensor
|
entity_class = MyUplinkDevicePointSensor
|
||||||
|
# Ignore sensors without a description that provide non-numeric values
|
||||||
|
if description is None and not isinstance(
|
||||||
|
device_point.value, (int, float)
|
||||||
|
):
|
||||||
|
continue
|
||||||
if (
|
if (
|
||||||
description is not None
|
description is not None
|
||||||
and description.device_class == SensorDeviceClass.ENUM
|
and description.device_class == SensorDeviceClass.ENUM
|
||||||
|
Loading…
x
Reference in New Issue
Block a user