mirror of
https://github.com/home-assistant/core.git
synced 2025-08-15 18:41:44 +02:00
Fix Shelly EM/3EM invalid energy value after reboot (#68052)
This commit is contained in:
committed by
Paulus Schoutsen
parent
a42ba9e10a
commit
31b19e09b5
@@ -174,6 +174,7 @@ SENSORS: Final = {
|
|||||||
value=lambda value: round(value / 1000, 2),
|
value=lambda value: round(value / 1000, 2),
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
|
available=lambda block: cast(int, block.energy) != -1,
|
||||||
),
|
),
|
||||||
("emeter", "energyReturned"): BlockSensorDescription(
|
("emeter", "energyReturned"): BlockSensorDescription(
|
||||||
key="emeter|energyReturned",
|
key="emeter|energyReturned",
|
||||||
@@ -182,6 +183,7 @@ SENSORS: Final = {
|
|||||||
value=lambda value: round(value / 1000, 2),
|
value=lambda value: round(value / 1000, 2),
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
|
available=lambda block: cast(int, block.energyReturned) != -1,
|
||||||
),
|
),
|
||||||
("light", "energy"): BlockSensorDescription(
|
("light", "energy"): BlockSensorDescription(
|
||||||
key="light|energy",
|
key="light|energy",
|
||||||
|
Reference in New Issue
Block a user