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
4 changed files with 4 additions and 3 deletions
|
@ -183,6 +183,7 @@ async def async_setup_entry(
|
|||
for description in sensors
|
||||
for value_key in {description.key, *description.alternative_keys}
|
||||
if description.value_fn(coordinator.data, value_key, description.scale)
|
||||
is not None
|
||||
)
|
||||
|
||||
async_add_entities(entities)
|
||||
|
|
|
@ -67,7 +67,7 @@ LAST_READING = Reading(
|
|||
"energyOut": 55048723044000.0,
|
||||
"energyOut1": 0.0,
|
||||
"energyOut2": 0.0,
|
||||
"power": 531750.0,
|
||||
"power": 0.0,
|
||||
"power1": 142680.0,
|
||||
"power2": 138010.0,
|
||||
"power3": 251060.0,
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
'energyOut': 55048723044000.0,
|
||||
'energyOut1': 0.0,
|
||||
'energyOut2': 0.0,
|
||||
'power': 531750.0,
|
||||
'power': 0.0,
|
||||
'power1': 142680.0,
|
||||
'power2': 138010.0,
|
||||
'power3': 251060.0,
|
||||
|
|
|
@ -132,7 +132,7 @@
|
|||
'entity_id': 'sensor.electricity_teststrasse_1_total_power',
|
||||
'last_changed': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': '531.75',
|
||||
'state': '0.0',
|
||||
})
|
||||
# ---
|
||||
# name: test_sensor[gas last transmitted]
|
||||
|
|
Loading…
Add table
Reference in a new issue