mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 08:17:08 +00:00
Explicit check for None in Discovergy entity if condition (#105248)
Fix checking for None in Discovergy
This commit is contained in:
parent
83a1ca5e83
commit
dd902bc956
@ -183,6 +183,7 @@ async def async_setup_entry(
|
|||||||
for description in sensors
|
for description in sensors
|
||||||
for value_key in {description.key, *description.alternative_keys}
|
for value_key in {description.key, *description.alternative_keys}
|
||||||
if description.value_fn(coordinator.data, value_key, description.scale)
|
if description.value_fn(coordinator.data, value_key, description.scale)
|
||||||
|
is not None
|
||||||
)
|
)
|
||||||
|
|
||||||
async_add_entities(entities)
|
async_add_entities(entities)
|
||||||
|
@ -67,7 +67,7 @@ LAST_READING = Reading(
|
|||||||
"energyOut": 55048723044000.0,
|
"energyOut": 55048723044000.0,
|
||||||
"energyOut1": 0.0,
|
"energyOut1": 0.0,
|
||||||
"energyOut2": 0.0,
|
"energyOut2": 0.0,
|
||||||
"power": 531750.0,
|
"power": 0.0,
|
||||||
"power1": 142680.0,
|
"power1": 142680.0,
|
||||||
"power2": 138010.0,
|
"power2": 138010.0,
|
||||||
"power3": 251060.0,
|
"power3": 251060.0,
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
'energyOut': 55048723044000.0,
|
'energyOut': 55048723044000.0,
|
||||||
'energyOut1': 0.0,
|
'energyOut1': 0.0,
|
||||||
'energyOut2': 0.0,
|
'energyOut2': 0.0,
|
||||||
'power': 531750.0,
|
'power': 0.0,
|
||||||
'power1': 142680.0,
|
'power1': 142680.0,
|
||||||
'power2': 138010.0,
|
'power2': 138010.0,
|
||||||
'power3': 251060.0,
|
'power3': 251060.0,
|
||||||
|
@ -132,7 +132,7 @@
|
|||||||
'entity_id': 'sensor.electricity_teststrasse_1_total_power',
|
'entity_id': 'sensor.electricity_teststrasse_1_total_power',
|
||||||
'last_changed': <ANY>,
|
'last_changed': <ANY>,
|
||||||
'last_updated': <ANY>,
|
'last_updated': <ANY>,
|
||||||
'state': '531.75',
|
'state': '0.0',
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
# name: test_sensor[gas last transmitted]
|
# name: test_sensor[gas last transmitted]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user