Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
tolwi committed Sep 5, 2024
2 parents 8d161da + 1e03006 commit a190b25
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@
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


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"),
Expand Down
3 changes: 3 additions & 0 deletions custom_components/ecoflow_cloud/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
76 changes: 76 additions & 0 deletions custom_components/ecoflow_cloud/translations/uk_UA.json
Original file line number Diff line number Diff line change
@@ -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": "Діагностичний режим"
}
}
}
}
}

0 comments on commit a190b25

Please sign in to comment.