diff --git a/manifest.json b/manifest.json index bfec058..df74e5a 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,9 @@ { "domain": "huawei_solar", "name": "Huawei Solar", + "after_dependencies": [ + "usb" + ], "config_flow": true, "documentation": "https://github.com/wlcrs/huawei_solar/wiki", "issue_tracker": "https://github.com/wlcrs/huawei_solar/issues", diff --git a/sensor.py b/sensor.py index a174ce9..11479f6 100644 --- a/sensor.py +++ b/sensor.py @@ -66,7 +66,7 @@ class HuaweiSolarSensorEntityDescription(SensorEntityDescription): def __post_init__(self): """Defaults the translation_key to the sensor key.""" - self.translation_key = self.translation_key or self.key + self.translation_key = self.translation_key or self.key.lower() # Every list in this file describes a group of entities which are related to each other. diff --git a/strings.json b/strings.json index e552c7a..0238082 100644 --- a/strings.json +++ b/strings.json @@ -53,31 +53,31 @@ "input_power": { "name": "Input power" }, - "line_voltage_A_B": { + "line_voltage_a_b": { "name": "A-B line voltage" }, - "line_voltage_B_C": { + "line_voltage_b_c": { "name": "B-C line voltage" }, - "line_voltage_C_A": { + "line_voltage_c_a": { "name": "C-A line voltage" }, - "phase_A_voltage": { + "phase_a_voltage": { "name": "Phase A voltage" }, - "phase_B_voltage": { + "phase_b_voltage": { "name": "Phase B voltage" }, - "phase_C_voltage": { + "phase_c_voltage": { "name": "Phase C voltage" }, - "phase_A_current": { + "phase_a_current": { "name": "Phase A current" }, - "phase_B_current": { + "phase_b_current": { "name": "Phase B current" }, - "phase_C_current": { + "phase_c_current": { "name": "Phase C current" }, "day_active_power_peak": { @@ -194,40 +194,40 @@ "grid_accumulated_reactive_power": { "name": "Reactive energy" }, - "grid_A_voltage": { + "grid_a_voltage": { "name": "Phase A voltage" }, - "grid_B_voltage": { + "grid_b_voltage": { "name": "Phase B voltage" }, - "grid_C_voltage": { + "grid_c_voltage": { "name": "Phase C voltage" }, - "grid_A_current": { + "grid_a_current": { "name": "Phase A current" }, - "grid_B_current": { + "grid_b_current": { "name": "Phase B current" }, - "grid_C_current": { + "grid_c_current": { "name": "Phase C current" }, - "active_grid_A_B_voltage": { + "active_grid_a_b_voltage": { "name": "A-B line voltage" }, - "active_grid_B_C_voltage": { + "active_grid_b_c_voltage": { "name": "B-C line voltage" }, - "active_grid_C_A_voltage": { + "active_grid_c_a_voltage": { "name": "C-A line voltage" }, - "active_grid_A_power": { + "active_grid_a_power": { "name": "Phase A active power" }, - "active_grid_B_power": { + "active_grid_b_power": { "name": "Phase B active power" }, - "active_grid_C_power": { + "active_grid_c_power": { "name": "Phase C active power" }, "storage_state_of_capacity": { @@ -422,7 +422,7 @@ }, "periods": { "name": "Periods", - "description": "One period per line. For Huawei LUNA2000 batteries: '-//', with 1=Monday, 7=Sunday (example: '12:00-14:00/1234567/-'). For LG RESU batteries: '-/' (example: 13:00-14:00/0.50)" + "description": "One period per line. For Huawei LUNA2000 batteries: '[start time]-[end time]/[days effective]/[charge]', with 1=Monday, 7=Sunday (example: '12:00-14:00/1234567/-'). For LG RESU batteries: '[start time]-[end time]/[electricity price]' (example: 13:00-14:00/0.50)" } } }, @@ -436,7 +436,7 @@ }, "periods": { "name": "Periods", - "description": "One period per line. Format: '-//W', with 1=Monday, 7=Sunday. Example: '00:00-23:59/1234567/2500W'." + "description": "One period per line. Format: '[start time]-[end time]/[days effective]/[power]W', with 1=Monday, 7=Sunday. Example: '00:00-23:59/1234567/2500W'." } } }, @@ -450,7 +450,7 @@ }, "periods": { "name": "Periods", - "description": "One period per line. Format: '-/W'. Example: '12:00-15:59/-1000W'." + "description": "One period per line. Format: '[start time]-[end time]/[power]W'. Example: '12:00-15:59/-1000W'." } } } diff --git a/translations/en.json b/translations/en.json index d947f2c..9e384b6 100644 --- a/translations/en.json +++ b/translations/en.json @@ -56,22 +56,22 @@ "accumulated_yield_energy": { "name": "Total yield" }, - "active_grid_A_B_voltage": { + "active_grid_a_b_voltage": { "name": "A-B line voltage" }, - "active_grid_A_power": { + "active_grid_a_power": { "name": "Phase A active power" }, - "active_grid_B_C_voltage": { + "active_grid_b_c_voltage": { "name": "B-C line voltage" }, - "active_grid_B_power": { + "active_grid_b_power": { "name": "Phase B active power" }, - "active_grid_C_A_voltage": { + "active_grid_c_a_voltage": { "name": "C-A line voltage" }, - "active_grid_C_power": { + "active_grid_c_power": { "name": "Phase C active power" }, "active_grid_frequency": { @@ -101,30 +101,30 @@ "efficiency": { "name": "Efficiency" }, - "grid_A_current": { + "grid_a_current": { "name": "Phase A current" }, - "grid_A_voltage": { + "grid_a_voltage": { "name": "Phase A voltage" }, - "grid_B_current": { + "grid_accumulated_energy": { + "name": "Consumption" + }, + "grid_accumulated_reactive_power": { + "name": "Reactive energy" + }, + "grid_b_current": { "name": "Phase B current" }, - "grid_B_voltage": { + "grid_b_voltage": { "name": "Phase B voltage" }, - "grid_C_current": { + "grid_c_current": { "name": "Phase C current" }, - "grid_C_voltage": { + "grid_c_voltage": { "name": "Phase C voltage" }, - "grid_accumulated_energy": { - "name": "Consumption" - }, - "grid_accumulated_reactive_power": { - "name": "Reactive energy" - }, "grid_exported_energy": { "name": "Exported" }, @@ -140,13 +140,13 @@ "internal_temperature": { "name": "Internal temperature" }, - "line_voltage_A_B": { + "line_voltage_a_b": { "name": "A-B line voltage" }, - "line_voltage_B_C": { + "line_voltage_b_c": { "name": "B-C line voltage" }, - "line_voltage_C_A": { + "line_voltage_c_a": { "name": "C-A line voltage" }, "meter_status": { @@ -164,22 +164,22 @@ "output_voltage": { "name": "Output voltage" }, - "phase_A_current": { + "phase_a_current": { "name": "Phase A current" }, - "phase_A_voltage": { + "phase_a_voltage": { "name": "Phase A voltage" }, - "phase_B_current": { + "phase_b_current": { "name": "Phase B current" }, - "phase_B_voltage": { + "phase_b_voltage": { "name": "Phase B voltage" }, - "phase_C_current": { + "phase_c_current": { "name": "Phase C current" }, - "phase_C_voltage": { + "phase_c_voltage": { "name": "Phase C voltage" }, "power_factor": { @@ -362,7 +362,7 @@ "name": "Battery" }, "periods": { - "description": "One period per line. Format: '-//W', with 1=Monday, 7=Sunday. Example: '00:00-23:59/1234567/2500W'.", + "description": "One period per line. Format: '[start time]-[end time]/[days effective]/[power]W', with 1=Monday, 7=Sunday. Example: '00:00-23:59/1234567/2500W'.", "name": "Periods" } }, @@ -386,7 +386,7 @@ "name": "Battery" }, "periods": { - "description": "One period per line. Format: '-/W'. Example: '12:00-15:59/-1000W'.", + "description": "One period per line. Format: '[start time]-[end time]/[power]W'. Example: '12:00-15:59/-1000W'.", "name": "Periods" } }, @@ -428,7 +428,7 @@ "name": "Battery" }, "periods": { - "description": "One period per line. For Huawei LUNA2000 batteries: '-//', with 1=Monday, 7=Sunday (example: '12:00-14:00/1234567/-'). For LG RESU batteries: '-/' (example: 13:00-14:00/0.50)", + "description": "One period per line. For Huawei LUNA2000 batteries: '[start time]-[end time]/[days effective]/[charge]', with 1=Monday, 7=Sunday (example: '12:00-14:00/1234567/-'). For LG RESU batteries: '[start time]-[end time]/[electricity price]' (example: 13:00-14:00/0.50)", "name": "Periods" } },