diff --git a/sensor.py b/sensor.py index f853942..056a1f9 100644 --- a/sensor.py +++ b/sensor.py @@ -1557,13 +1557,13 @@ def _days_effective_to_str(days: tuple[bool, bool, bool, bool, bool, bool, bool] value = "" for i in range(7): # Sunday is on index 0, but we want to name it day 7 if days[(i + 1) % 7]: - value += f"{i+1}" + value += f"{i + 1}" return value def _time_int_to_str(time): - return f"{time//60:02d}:{time%60:02d}" + return f"{time // 60:02d}:{time % 60:02d}" class HuaweiSolarTOUPricePeriodsSensorEntity( @@ -1633,14 +1633,14 @@ def _handle_coordinator_update(self) -> None: self._attr_extra_state_attributes.clear() elif isinstance(data[0], LG_RESU_TimeOfUsePeriod): self._attr_extra_state_attributes = { - f"Period {idx+1}": self._lg_resu_period_to_text( + f"Period {idx + 1}": self._lg_resu_period_to_text( cast(LG_RESU_TimeOfUsePeriod, period) ) for idx, period in enumerate(data) } elif isinstance(data[0], HUAWEI_LUNA2000_TimeOfUsePeriod): self._attr_extra_state_attributes = { - f"Period {idx+1}": self._huawei_luna2000_period_to_text(period) + f"Period {idx + 1}": self._huawei_luna2000_period_to_text(period) for idx, period in enumerate(data) } else: @@ -1704,7 +1704,7 @@ def _handle_coordinator_update(self) -> None: self._attr_available = True self._attr_native_value = len(data) self._attr_extra_state_attributes = { - f"Period {idx+1}": self._period_to_text(period) + f"Period {idx + 1}": self._period_to_text(period) for idx, period in enumerate(data) } else: diff --git a/strings.json b/strings.json index 3377b7c..ca1b2e7 100644 --- a/strings.json +++ b/strings.json @@ -129,6 +129,15 @@ "phase_c_current": { "name": "Phase C current" }, + "active_grid_a_current": { + "name": "Phase A current" + }, + "active_grid_b_current": { + "name": "Phase B current" + }, + "active_grid_c_current": { + "name": "Phase C current" + }, "day_active_power_peak": { "name": "Day active power peak" }, @@ -486,7 +495,7 @@ "active_power_control": { "name": "Active power control" }, - "soh_calibration_status":{ + "soh_calibration_status": { "name": "SOH calibration status" }, "pack_1_max_temperature": { @@ -494,13 +503,13 @@ }, "pack_1_min_temperature": { "name": "Pack 1 min temperature" - }, + }, "pack_2_max_temperature": { "name": "Pack 2 max temperature" }, "pack_2_min_temperature": { "name": "Pack 2 min temperature" - }, + }, "pack_3_max_temperature": { "name": "Pack 3 max temperature" }, @@ -509,17 +518,16 @@ }, "pack_1_working_status": { "name": "Pack 1 working status" - }, + }, "pack_2_working_status": { "name": "Pack 2 working status" - }, + }, "pack_3_working_status": { "name": "Pack 3 working status" - }, - + }, "pack_1_firmware_version": { "name": "Pack 1 firmware version" - }, + }, "pack_1_serial_number": { "name": "Pack 1 serial number" }, @@ -544,10 +552,9 @@ "pack_1_total_discharge": { "name": "Pack 1 total discharge" }, - "pack_2_firmware_version": { "name": "Pack 2 firmware version" - }, + }, "pack_2_serial_number": { "name": "Pack 2 serial number" }, @@ -572,10 +579,9 @@ "pack_2_total_discharge": { "name": "Pack 2 total discharge" }, - "pack_3_firmware_version": { "name": "Pack 3 firmware version" - }, + }, "pack_3_serial_number": { "name": "Pack 3 serial number" }, @@ -600,8 +606,6 @@ "pack_3_total_discharge": { "name": "Pack 3 total discharge" }, - - "bms_temperature": { "name": "BMS temperature" }, @@ -964,4 +968,4 @@ "name": "Battery 2" } } -} \ No newline at end of file +} diff --git a/translations/ca.json b/translations/ca.json index 3c2858e..9006f54 100644 --- a/translations/ca.json +++ b/translations/ca.json @@ -90,6 +90,12 @@ }, "emma_maximum_feed_grid_power_watt": { "name": "Maximum feed grid power" +<<<<<<< HEAD +======= + }, + "mppt_scanning_interval": { + "name": "MPPT scan interval" +>>>>>>> 18f7306 (Fix missing translations for power meter current sensors) } }, "sensor": { @@ -489,36 +495,12 @@ "soh_calibration_status": { "name": "SOH calibration status" }, - "pack_1_max_temperature": { - "name": "Pack 1 max temperature" - }, - "pack_1_min_temperature": { - "name": "Pack 1 min temperature" - }, - "pack_2_max_temperature": { - "name": "Pack 2 max temperature" - }, - "pack_2_min_temperature": { - "name": "Pack 2 min temperature" - }, - "pack_3_max_temperature": { - "name": "Pack 3 max temperature" - }, - "pack_3_min_temperature": { - "name": "Pack 3 min temperature" - }, - "pack_1_working_status": { - "name": "Pack 1 working status" - }, "pack_2_working_status": { "name": "Pack 2 working status" }, "pack_3_working_status": { "name": "Pack 3 working status" }, - "pack_1_firmware_version": { - "name": "Pack 1 firmware version" - }, "pack_1_serial_number": { "name": "Pack 1 serial number" }, @@ -695,6 +677,39 @@ }, "backup_power_state_of_charge": { "name": "Backup power state of charge" + }, + "pack_1_max_temperature": { + "name": "Pack 1 max temperature" + }, + "pack_1_min_temperature": { + "name": "Pack 1 min temperature" + }, + "pack_2_max_temperature": { + "name": "Pack 2 max temperature" + }, + "pack_2_min_temperature": { + "name": "Pack 2 min temperature" + }, + "pack_3_max_temperature": { + "name": "Pack 3 max temperature" + }, + "pack_3_min_temperature": { + "name": "Pack 3 min temperature" + }, + "pack_1_working_status": { + "name": "Pack 1 working status" + }, + "pack_1_firmware_version": { + "name": "Pack 1 firmware version" + }, + "active_grid_a_current": { + "name": "Corrent de fase A" + }, + "active_grid_b_current": { + "name": "Corrent de fase B" + }, + "active_grid_c_current": { + "name": "Corrent de fase C" } }, "select": { @@ -959,4 +974,4 @@ "name": "Battery 2" } } -} \ No newline at end of file +} diff --git a/translations/ca_ES.json b/translations/ca_ES.json index 3fd7016..21580e8 100644 --- a/translations/ca_ES.json +++ b/translations/ca_ES.json @@ -73,8 +73,8 @@ }, "storage_power_of_charge_from_grid": { "name": "Potència màxima de càrrega des de la xarxa" - }, - "mppt_scanning_interval":{ + }, + "mppt_scanning_interval": { "name": "MPPT scan interval" } }, @@ -530,7 +530,7 @@ "total_energy_consumption": { "name": "Total energy consumption" }, - "soh_calibration_status":{ + "soh_calibration_status": { "name": "SOH calibration status" }, "pack_1_max_temperature": { @@ -538,13 +538,13 @@ }, "pack_1_min_temperature": { "name": "Pack 1 min temperature" - }, + }, "pack_2_max_temperature": { "name": "Pack 2 max temperature" }, "pack_2_min_temperature": { "name": "Pack 2 min temperature" - }, + }, "pack_3_max_temperature": { "name": "Pack 3 max temperature" }, @@ -553,14 +553,14 @@ }, "pack_1_working_status": { "name": "Pack 1 working status" - }, + }, "pack_2_working_status": { "name": "Pack 2 working status" - }, + }, "pack_3_working_status": { "name": "Pack 3 working status" - }, - "pack_1_firmware_version": { + }, + "pack_1_firmware_version": { "name": "Pack 1 firmware version" }, "pack_1_serial_number": { @@ -587,10 +587,9 @@ "pack_1_total_discharge": { "name": "Pack 1 total discharge" }, - "pack_2_firmware_version": { "name": "Pack 2 firmware version" - }, + }, "pack_2_serial_number": { "name": "Pack 2 serial number" }, @@ -615,10 +614,9 @@ "pack_2_total_discharge": { "name": "Pack 2 total discharge" }, - "pack_3_firmware_version": { "name": "Pack 3 firmware version" - }, + }, "pack_3_serial_number": { "name": "Pack 3 serial number" }, @@ -643,9 +641,17 @@ "pack_3_total_discharge": { "name": "Pack 3 total discharge" }, - "bms_temperature": { "name": "BMS temperature" + }, + "active_grid_a_current": { + "name": "Corrent de fase A" + }, + "active_grid_b_current": { + "name": "Corrent de fase B" + }, + "active_grid_c_current": { + "name": "Corrent de fase C" } }, "switch": { @@ -844,4 +850,4 @@ "name": "Aturar la càrrega o descàrrega forçada" } } -} \ No newline at end of file +} diff --git a/translations/de.json b/translations/de.json index 302724a..ed0656b 100644 --- a/translations/de.json +++ b/translations/de.json @@ -267,6 +267,15 @@ "grid_c_current": { "name": "Phase C Strom" }, + "active_grid_a_current": { + "name": "Phase A Strom" + }, + "active_grid_b_current": { + "name": "Phase B Strom" + }, + "active_grid_c_current": { + "name": "Phase C Strom" + }, "active_grid_a_b_voltage": { "name": "A-B-Netzspannung" }, @@ -959,4 +968,4 @@ "name": "Batterie 2" } } -} \ No newline at end of file +} diff --git a/translations/en.json b/translations/en.json index 18e893a..1122791 100644 --- a/translations/en.json +++ b/translations/en.json @@ -87,8 +87,8 @@ }, "emma_maximum_feed_grid_power_watt": { "name": "Maximum feed grid power" - }, - "mppt_scanning_interval":{ + }, + "mppt_scanning_interval": { "name": "MPPT scan interval" } }, @@ -628,7 +628,7 @@ "backup_power_state_of_charge": { "name": "Backup power state of charge" }, - "soh_calibration_status":{ + "soh_calibration_status": { "name": "SOH calibration status" }, "pack_1_max_temperature": { @@ -636,13 +636,13 @@ }, "pack_1_min_temperature": { "name": "Pack 1 min temperature" - }, + }, "pack_2_max_temperature": { "name": "Pack 2 max temperature" }, "pack_2_min_temperature": { "name": "Pack 2 min temperature" - }, + }, "pack_3_max_temperature": { "name": "Pack 3 max temperature" }, @@ -651,14 +651,14 @@ }, "pack_1_working_status": { "name": "Pack 1 working status" - }, + }, "pack_2_working_status": { "name": "Pack 2 working status" - }, + }, "pack_3_working_status": { "name": "Pack 3 working status" - }, - "pack_1_firmware_version": { + }, + "pack_1_firmware_version": { "name": "Pack 1 firmware version" }, "pack_1_serial_number": { @@ -685,10 +685,9 @@ "pack_1_total_discharge": { "name": "Pack 1 total discharge" }, - "pack_2_firmware_version": { "name": "Pack 2 firmware version" - }, + }, "pack_2_serial_number": { "name": "Pack 2 serial number" }, @@ -713,10 +712,9 @@ "pack_2_total_discharge": { "name": "Pack 2 total discharge" }, - "pack_3_firmware_version": { "name": "Pack 3 firmware version" - }, + }, "pack_3_serial_number": { "name": "Pack 3 serial number" }, @@ -741,9 +739,17 @@ "pack_3_total_discharge": { "name": "Pack 3 total discharge" }, - "bms_temperature": { "name": "BMS temperature" + }, + "active_grid_a_current": { + "name": "Phase A current" + }, + "active_grid_b_current": { + "name": "Phase B current" + }, + "active_grid_c_current": { + "name": "Phase C current" } }, "switch": { @@ -962,4 +968,4 @@ "name": "Battery 2" } } -} \ No newline at end of file +} diff --git a/translations/es.json b/translations/es.json index f8f1b99..a08e35f 100644 --- a/translations/es.json +++ b/translations/es.json @@ -89,7 +89,14 @@ "name": "Máxima potencia de la red de alimentación (%)" }, "emma_maximum_feed_grid_power_watt": { +<<<<<<< HEAD "name": "Máxima alimentación de red" +======= + "name": "Maximum feed grid power" + }, + "mppt_scanning_interval": { + "name": "MPPT scan interval" +>>>>>>> 18f7306 (Fix missing translations for power meter current sensors) } }, "sensor": { @@ -267,6 +274,15 @@ "grid_c_current": { "name": "Corriente de fase C" }, + "active_grid_a_current": { + "name": "Corriente de fase A" + }, + "active_grid_b_current": { + "name": "Corriente de fase B" + }, + "active_grid_c_current": { + "name": "Corriente de fase C" + }, "active_grid_a_b_voltage": { "name": "Tensión de línea A-B" }, @@ -959,4 +975,4 @@ "name": "Battery 2" } } -} \ No newline at end of file +} diff --git a/translations/es_ES.json b/translations/es_ES.json index dcbccf2..f0cafe8 100644 --- a/translations/es_ES.json +++ b/translations/es_ES.json @@ -73,8 +73,8 @@ }, "storage_power_of_charge_from_grid": { "name": "Potencia máxima de carga desde la red" - }, - "mppt_scanning_interval":{ + }, + "mppt_scanning_interval": { "name": "MPPT scan interval" } }, @@ -167,6 +167,15 @@ "grid_a_current": { "name": "Corriente de fase A" }, + "active_grid_a_current": { + "name": "Corriente de fase A" + }, + "active_grid_b_current": { + "name": "Corriente de fase B" + }, + "active_grid_c_current": { + "name": "Corriente de fase C" + }, "grid_a_voltage": { "name": "Tensión de fase A" }, @@ -527,7 +536,7 @@ "total_energy_consumption": { "name": "Total energy consumption" }, - "soh_calibration_status":{ + "soh_calibration_status": { "name": "SOH calibration status" }, "pack_1_max_temperature": { @@ -535,13 +544,13 @@ }, "pack_1_min_temperature": { "name": "Pack 1 min temperature" - }, + }, "pack_2_max_temperature": { "name": "Pack 2 max temperature" }, "pack_2_min_temperature": { "name": "Pack 2 min temperature" - }, + }, "pack_3_max_temperature": { "name": "Pack 3 max temperature" }, @@ -550,13 +559,13 @@ }, "pack_1_working_status": { "name": "Pack 1 working status" - }, + }, "pack_2_working_status": { "name": "Pack 2 working status" - }, + }, "pack_3_working_status": { "name": "Pack 3 working status" - }, + }, "pack_1_firmware_version": { "name": "Pack 1 firmware version" }, @@ -584,10 +593,9 @@ "pack_1_total_discharge": { "name": "Pack 1 total discharge" }, - "pack_2_firmware_version": { "name": "Pack 2 firmware version" - }, + }, "pack_2_serial_number": { "name": "Pack 2 serial number" }, @@ -612,10 +620,9 @@ "pack_2_total_discharge": { "name": "Pack 2 total discharge" }, - "pack_3_firmware_version": { "name": "Pack 3 firmware version" - }, + }, "pack_3_serial_number": { "name": "Pack 3 serial number" }, @@ -640,7 +647,6 @@ "pack_3_total_discharge": { "name": "Pack 3 total discharge" }, - "bms_temperature": { "name": "BMS temperature" } @@ -841,4 +847,4 @@ "name": "Detener la carga o descarga forzada" } } -} \ No newline at end of file +} diff --git a/translations/fr.json b/translations/fr.json index a6efad0..4aaeeab 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -90,6 +90,12 @@ }, "emma_maximum_feed_grid_power_watt": { "name": "Maximum feed grid power" +<<<<<<< HEAD +======= + }, + "mppt_scanning_interval": { + "name": "MPPT scan interval" +>>>>>>> 18f7306 (Fix missing translations for power meter current sensors) } }, "sensor": { @@ -267,6 +273,15 @@ "grid_c_current": { "name": "Courant de la phase C" }, + "active_grid_a_current": { + "name": "Courant de la phase A" + }, + "active_grid_b_current": { + "name": "Courant de la phase B" + }, + "active_grid_c_current": { + "name": "Courant de la phase C" + }, "active_grid_a_b_voltage": { "name": "Tension ligne A-B" }, @@ -959,4 +974,4 @@ "name": "Battery 2" } } -} \ No newline at end of file +} diff --git a/translations/it.json b/translations/it.json index f922ebe..056992d 100644 --- a/translations/it.json +++ b/translations/it.json @@ -129,6 +129,15 @@ "phase_c_current": { "name": "Corrente fase C" }, + "active_grid_a_current": { + "name": "Corrente fase A" + }, + "active_grid_b_current": { + "name": "Corrente fase B" + }, + "active_grid_c_current": { + "name": "Corrente fase C" + }, "day_active_power_peak": { "name": "Picco di potenza giornaliero" }, @@ -694,7 +703,38 @@ "name": "Capacità di scarica ESS" }, "backup_power_state_of_charge": { +<<<<<<< HEAD "name": "Stato di carica del backup di potenza" +======= + "name": "Backup power state of charge" + }, + "pack_1_max_temperature": { + "name": "Pack 1 max temperature" + }, + "pack_1_min_temperature": { + "name": "Pack 1 min temperature" + }, + "pack_2_max_temperature": { + "name": "Pack 2 max temperature" + }, + "pack_2_min_temperature": { + "name": "Pack 2 min temperature" + }, + "pack_3_max_temperature": { + "name": "Pack 3 max temperature" + }, + "pack_3_min_temperature": { + "name": "Pack 3 min temperature" + }, + "pack_1_working_status": { + "name": "Pack 1 working status" + }, + "pack_1_firmware_version": { + "name": "Pack 1 firmware version" + }, + "bms_temperature": { + "name": "BMS temperature" +>>>>>>> 18f7306 (Fix missing translations for power meter current sensors) } }, "select": { @@ -959,4 +999,4 @@ "name": "Batteria 2" } } -} \ No newline at end of file +} diff --git a/translations/nl.json b/translations/nl.json index 5ee832d..900d804 100644 --- a/translations/nl.json +++ b/translations/nl.json @@ -90,6 +90,12 @@ }, "emma_maximum_feed_grid_power_watt": { "name": "Maximum feed grid power" +<<<<<<< HEAD +======= + }, + "mppt_scanning_interval": { + "name": "MPPT scan interval" +>>>>>>> 18f7306 (Fix missing translations for power meter current sensors) } }, "sensor": { @@ -267,6 +273,15 @@ "grid_c_current": { "name": "Fase C stroom" }, + "active_grid_a_current": { + "name": "Fase A stroom" + }, + "active_grid_b_current": { + "name": "Fase B stroom" + }, + "active_grid_c_current": { + "name": "Fase C stroom" + }, "active_grid_a_b_voltage": { "name": "A-B lijnspanning" }, @@ -959,4 +974,4 @@ "name": "Batterij 2" } } -} \ No newline at end of file +} diff --git a/translations/pl.json b/translations/pl.json index 2101030..63a7654 100644 --- a/translations/pl.json +++ b/translations/pl.json @@ -267,6 +267,15 @@ "grid_c_current": { "name": "Prąd fazowy C" }, + "active_grid_a_current": { + "name": "Prąd fazowy A" + }, + "active_grid_b_current": { + "name": "Prąd fazowy B" + }, + "active_grid_c_current": { + "name": "Prąd fazowy C" + }, "active_grid_a_b_voltage": { "name": "Napięcie międzyfazowe A-B" }, @@ -959,4 +968,4 @@ "name": "Battery 2" } } -} \ No newline at end of file +} diff --git a/translations/pt.json b/translations/pt.json index 6cbec9d..c3f667f 100644 --- a/translations/pt.json +++ b/translations/pt.json @@ -267,6 +267,15 @@ "grid_c_current": { "name": "Phase C current" }, + "active_grid_a_current": { + "name": "Phase A current" + }, + "active_grid_b_current": { + "name": "Phase B current" + }, + "active_grid_c_current": { + "name": "Phase C current" + }, "active_grid_a_b_voltage": { "name": "A-B line voltage" }, @@ -695,6 +704,36 @@ }, "backup_power_state_of_charge": { "name": "Backup power state of charge" +<<<<<<< HEAD +======= + }, + "pack_1_max_temperature": { + "name": "Pack 1 max temperature" + }, + "pack_1_min_temperature": { + "name": "Pack 1 min temperature" + }, + "pack_2_max_temperature": { + "name": "Pack 2 max temperature" + }, + "pack_2_min_temperature": { + "name": "Pack 2 min temperature" + }, + "pack_3_max_temperature": { + "name": "Pack 3 max temperature" + }, + "pack_3_min_temperature": { + "name": "Pack 3 min temperature" + }, + "pack_1_working_status": { + "name": "Pack 1 working status" + }, + "pack_1_firmware_version": { + "name": "Pack 1 firmware version" + }, + "bms_temperature": { + "name": "BMS temperature" +>>>>>>> 18f7306 (Fix missing translations for power meter current sensors) } }, "select": { @@ -959,4 +998,4 @@ "name": "Battery 2" } } -} \ No newline at end of file +} diff --git a/translations/ur.json b/translations/ur.json index 5b5d236..eabb656 100644 --- a/translations/ur.json +++ b/translations/ur.json @@ -90,6 +90,12 @@ }, "emma_maximum_feed_grid_power_watt": { "name": "Maximum feed grid power" +<<<<<<< HEAD +======= + }, + "mppt_scanning_interval": { + "name": "MPPT scan interval" +>>>>>>> 18f7306 (Fix missing translations for power meter current sensors) } }, "sensor": { @@ -267,6 +273,15 @@ "grid_c_current": { "name": "فیز سی کرنٹ" }, + "active_grid_a_current": { + "name": "فیز اے کرنٹ" + }, + "active_grid_b_current": { + "name": "فیز بی کرنٹ" + }, + "active_grid_c_current": { + "name": "فیز سی کرنٹ" + }, "active_grid_a_b_voltage": { "name": "اے بی لائن وولٹیج" }, @@ -959,4 +974,4 @@ "name": "Battery 2" } } -} \ No newline at end of file +}