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:
Thomas Ytterdal
2024-06-03 01:09:56 +00:00
committed by Paulus Schoutsen
co-authored by Jan-Philipp Benecke
parent b39d7b39e1
commit c52fabcf77
@@ -160,6 +160,11 @@ async def async_setup_entry(
if find_matching_platform(device_point) == Platform.SENSOR:
description = get_description(device_point)
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 (
description is not None
and description.device_class == SensorDeviceClass.ENUM