Skip to content

Commit 317c94b

Browse files
author
marq24
committed
fixed new yield-entities (to ake them usable in energy dashboard)
1 parent bfb2c4b commit 317c94b

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

custom_components/senec/const.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -901,15 +901,18 @@ class ExtNumberEntityDescription(NumberEntityDescription):
901901
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
902902
suggested_display_precision=3,
903903
icon="mdi:lightning-bolt",
904-
state_class=SensorStateClass.MEASUREMENT,
904+
device_class=SensorDeviceClass.ENERGY,
905+
state_class=SensorStateClass.TOTAL_INCREASING,
906+
905907
),
906908
ExtSensorEntityDescription(
907909
key="yield_produced_total",
908910
name="produced total yield",
909911
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
910912
suggested_display_precision=3,
911913
icon="mdi:lightning-bolt",
912-
state_class=SensorStateClass.MEASUREMENT,
914+
device_class=SensorDeviceClass.ENERGY,
915+
state_class=SensorStateClass.TOTAL_INCREASING,
913916
)
914917
]
915918

custom_components/senec/pysenec_ha/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2490,7 +2490,7 @@ async def read_inverter(self):
24902490
self._derating = float(100.0 - float(a_dict["@Value"]))
24912491

24922492
if self._YIELD_DATA_READ_TS + 300 < time():
2493-
async with self.web_session.get(f"{self.url_yield}&_={datetime.now()}") as res:
2493+
async with self.web_session.get(f"{self.url_yield}&_={time()}") as res:
24942494
self._YIELD_DATA_READ_TS = time()
24952495
res.raise_for_status()
24962496
yield_data = await res.json()

0 commit comments

Comments
 (0)