Skip to content

Commit efd6b97

Browse files
authored
fix: No monthly data returned handling (#218)
1 parent 1ee9898 commit efd6b97

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

custom_components/iec/coordinator.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,16 @@ async def _async_update_data(
469469
remote_reading.future_consumption_info
470470
)
471471

472-
daily_readings[device.device_number] = remote_reading.data
472+
if remote_reading and remote_reading.data:
473+
daily_readings[device.device_number] = remote_reading.data
474+
else:
475+
_LOGGER.warning(
476+
"No Monthly readings returned for device %s in contract %s on %s",
477+
device.device_number,
478+
contract_id,
479+
localized_today.strftime("%Y-%m-%d"),
480+
)
481+
daily_readings[device.device_number] = []
473482

474483
weekly_future_consumption = None
475484
if localized_today.day == 1:

0 commit comments

Comments
 (0)