Skip to content

Commit 2d09adf

Browse files
authored
fix: Fix tuple multiplication (#177)
1 parent f8a3ebc commit 2d09adf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

custom_components/iec/coordinator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -725,9 +725,9 @@ def _calculate_estimated_bill(meter_id, future_consumptions: dict[str, FutureCon
725725
total_days = today.day
726726
days_in_current_month = calendar.monthrange(today.year, today.month)[1]
727727

728-
consumption_price = future_consumption * kwh_tariff, 2
729-
total_kva_price = kva_price * total_days, 2
730-
distribution_price = (distribution_tariff / days_in_current_month) * total_days, 2
728+
consumption_price = round(future_consumption * kwh_tariff, 2)
729+
total_kva_price = round(kva_price * total_days, 2)
730+
distribution_price = round((distribution_tariff / days_in_current_month) * total_days, 2)
731731
delivery_price = (delivery_tariff / days_in_current_month) * total_days
732732

733733
_LOGGER.debug(f'Calculated estimated bill: No. of days: {total_days}, total KVA price: {total_kva_price}, '

0 commit comments

Comments
 (0)