Skip to content

Commit 1e579dd

Browse files
authored
fix: Issue when there's no connection size found (#164)
1 parent c6bf3ce commit 1e579dd

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

custom_components/iec/coordinator.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,12 +658,15 @@ async def _estimate_bill(self, contract_id, device_number, is_private_producer,
658658
if connection_size:
659659
power_size = await self._get_power_size(connection_size)
660660
else:
661+
power_size = 0.0
661662
_LOGGER.warning("Couldn't get Connection Size")
662663

663664
if phase_count:
664665
distribution_tariff = await self._get_distribution_tariff(phase_count)
665666
delivery_tariff = await self._get_delivery_tariff(phase_count)
666667
else:
668+
distribution_tariff = 0.0
669+
delivery_tariff = 0.0
667670
if connection_size:
668671
_LOGGER.warning("Couldn't get Phase Count")
669672

custom_components/iec/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
"issue_tracker": "https://github.com/guykh/iec-custom-component/issues",
1212
"loggers": ["iec_api"],
1313
"requirements": ["iec-api==0.4.3"],
14-
"version": "0.0.33-b2"
14+
"version": "0.0.33-b3"
1515
}

0 commit comments

Comments
 (0)