From 28d354e620e18129ab15e45c9d3e74c2f591b663 Mon Sep 17 00:00:00 2001 From: Andrii-Zakhliupanyi Date: Tue, 3 Sep 2024 11:22:49 +0300 Subject: [PATCH 1/3] add ukrainian (#313) --- .../ecoflow_cloud/translations/uk_UA.json | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 custom_components/ecoflow_cloud/translations/uk_UA.json diff --git a/custom_components/ecoflow_cloud/translations/uk_UA.json b/custom_components/ecoflow_cloud/translations/uk_UA.json new file mode 100644 index 0000000..04b1daf --- /dev/null +++ b/custom_components/ecoflow_cloud/translations/uk_UA.json @@ -0,0 +1,76 @@ +{ + "title": "EcoFlow-Cloud", + "config": { + "step": { + "user": { + "data": { + "group": "Група пристроїв" + } + }, + "api": { + "menu_options": { + "api_add_device": "Додати пристрій", + "remove_device": "Видалити пристрій", + "finish": "Завершити" + }, + "data": { + "access_key": "Access key", + "secret_key": "Secret key", + "load_all_devices": "Автоматичне завантаження пристроїв" + } + }, + "choose_type": { + "menu_options": { + "api": "Використовувати public API", + "manual": "Використовувати application API" + } + }, + "select_device": { + "data": { + "select_device": "Вибрати пристрій" + } + }, + "confirm_cloud_device": { + "data": { + "device_type": "Тип пристрою", + "device_name": "Назва пристрою", + "device_id": "SN пристрою" + } + }, + "manual": { + "menu_options": { + "manual_add_device": "Додати пристрій", + "remove_device": "Видалити пристрій", + "finish": "Завершити" + }, + "data": { + "username": "Email користувача", + "password": "Password користувача" + } + }, + "manual_device_input": { + "data": { + "device_type": "Тип пристрою", + "device_name": "Назва пристрою", + "device_id": "SN пристрою" + } + } + } + }, + "options": { + "step": { + "init": { + "data": { + "select_device": "Вибрати пристрій" + } + }, + "options": { + "data": { + "power_step": "Крок регулятора потужності заряджання", + "refresh_period_sec": "Період оновлення даних (сек)", + "diagnostic_mode": "Діагностичний режим" + } + } + } + } +} From c1a4915347b89bdac1d97d980bb743b51c848695 Mon Sep 17 00:00:00 2001 From: Dev-Fabry <161500477+Dev-Fabry@users.noreply.github.com> Date: Thu, 5 Sep 2024 07:01:59 +0200 Subject: [PATCH 2/3] Update powerstream.py (#317) Corrected typo "disharge" to "discharge" in commented code --- custom_components/ecoflow_cloud/devices/internal/powerstream.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/ecoflow_cloud/devices/internal/powerstream.py b/custom_components/ecoflow_cloud/devices/internal/powerstream.py index e7c5da5..8500c95 100644 --- a/custom_components/ecoflow_cloud/devices/internal/powerstream.py +++ b/custom_components/ecoflow_cloud/devices/internal/powerstream.py @@ -92,7 +92,7 @@ def sensors(self, client: EcoflowApiClient) -> list[BaseSensorEntity]: def numbers(self, client: EcoflowApiClient) -> list[BaseNumberEntity]: return [ # These will likely be some form of serialised data rather than JSON will look into it later - # MinBatteryLevelEntity(client, self, "lowerLimit", "Min Disharge Level", 50, 100, + # MinBatteryLevelEntity(client, self, "lowerLimit", "Min Discharge Level", 50, 100, # lambda value: {"moduleType": 0, "operateType": "TCP", # "params": {"id": 00, "lowerLimit": value}}), # MaxBatteryLevelEntity(client, self, "upperLimit", "Max Charge Level", 0, 30, From 1e030063753657c65442b9e71f5b250219ddee21 Mon Sep 17 00:00:00 2001 From: Dev-Fabry <161500477+Dev-Fabry@users.noreply.github.com> Date: Thu, 5 Sep 2024 07:03:47 +0200 Subject: [PATCH 3/3] 300-add-esp-temperature (#318) * Update sensor.py Add CelsiusSensorEntity class * Update powerstream.py Added 20_1.espTempsensor as "ESP Temperature" --- custom_components/ecoflow_cloud/devices/public/powerstream.py | 4 +++- custom_components/ecoflow_cloud/sensor.py | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/custom_components/ecoflow_cloud/devices/public/powerstream.py b/custom_components/ecoflow_cloud/devices/public/powerstream.py index bf17b52..4f31e18 100644 --- a/custom_components/ecoflow_cloud/devices/public/powerstream.py +++ b/custom_components/ecoflow_cloud/devices/public/powerstream.py @@ -5,7 +5,7 @@ from ...number import MinBatteryLevelEntity, MaxBatteryLevelEntity, BrightnessLevelEntity, DeciChargingPowerEntity from ...select import PowerDictSelectEntity from ...sensor import StatusSensorEntity, InWattsSolarSensorEntity, DecivoltSensorEntity, CentivoltSensorEntity, \ - DeciampSensorEntity, DecicelsiusSensorEntity, MiscSensorEntity, LevelSensorEntity, DeciwattsSensorEntity, \ + DeciampSensorEntity, CelsiusSensorEntity, DecicelsiusSensorEntity, MiscSensorEntity, LevelSensorEntity, DeciwattsSensorEntity, \ AmpSensorEntity, RemainSensorEntity, DecihertzSensorEntity @@ -13,6 +13,8 @@ class PowerStream(BaseDevice): def sensors(self, client: EcoflowApiClient) -> list[BaseSensorEntity]: return [ + CelsiusSensorEntity(client, self, "20_1.espTempsensor", "ESP Temperature"), + InWattsSolarSensorEntity(client, self, "20_1.pv1InputWatts", "Solar 1 Watts"), DecivoltSensorEntity(client, self, "20_1.pv1InputVolt", "Solar 1 Input Potential"), CentivoltSensorEntity(client, self, "20_1.pv1OpVolt", "Solar 1 Op Potential"), diff --git a/custom_components/ecoflow_cloud/sensor.py b/custom_components/ecoflow_cloud/sensor.py index 5c8d1ba..964fc2a 100644 --- a/custom_components/ecoflow_cloud/sensor.py +++ b/custom_components/ecoflow_cloud/sensor.py @@ -107,6 +107,9 @@ class TempSensorEntity(BaseSensorEntity): _attr_state_class = SensorStateClass.MEASUREMENT _attr_native_value = -1 +class CelsiusSensorEntity(TempSensorEntity): + def _update_value(self, val: Any) -> bool: + return super()._update_value(int(val)) class DecicelsiusSensorEntity(TempSensorEntity): def _update_value(self, val: Any) -> bool: