Skip to content

Commit

Permalink
Fix Backup Reserve Switch Delta 2 & River 2 Max (#162)
Browse files Browse the repository at this point in the history
* Update manifest.json

* Update river2_max.py

* Update river2_max.py

* Update .gitignore

* Update river2_max.py

* Update manifest.json

* Update delta2.py

* Update delta2.py

* Update delta2.py

* Update river2_max.py
  • Loading branch information
neotigger committed Oct 10, 2023
1 parent e58181a commit 50e56ee
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
__pycache__
venv
.idea
.idea
.DS_Store
17 changes: 9 additions & 8 deletions custom_components/ecoflow_cloud/devices/delta2.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,11 @@ def switches(self, client: EcoflowMQTTClient) -> list[BaseSwitchEntity]:

EnabledEntity(client, "pd.dcOutState", const.USB_ENABLED,
lambda value: {"moduleType": 1, "operateType": "dcOutCfg", "params": {"enabled": value}}),

# EnabledEntity(client, "pd.acAutoOnCfg", const.AC_ALWAYS_ENABLED,
# lambda value: {"moduleType": 1, "operateType": "acAutoOn", "params": {"cfg": value}}),


EnabledEntity(client, "pd.acAutoOutConfig", const.AC_ALWAYS_ENABLED,
lambda value, params: {"moduleType": 1, "operateType": "acAutoOutConfig",
"params": {"acAutoOutConfig": value,
"minAcOutSoc": int(params.get("bms_emsStatus.minDsgSoc", 0)) + 5}}
),
"minAcOutSoc": int(params.get("bms_emsStatus.minDsgSoc", 0)) + 5}}),

EnabledEntity(client, "pd.pvChgPrioSet", const.PV_PRIO,
lambda value: {"moduleType": 1, "operateType": "pvChangePrio",
Expand All @@ -146,8 +142,13 @@ def switches(self, client: EcoflowMQTTClient) -> list[BaseSwitchEntity]:
lambda value: {"moduleType": 5, "operateType": "mpptCar", "params": {"enabled": value}}),

EnabledEntity(client, "pd.bpPowerSoc", const.BP_ENABLED,
lambda value: {"moduleType": 1, "operateType": "watthConfig", "params": {"isConfig": value}}),
]
lambda value: {"moduleType": 1,
"operateType": "watthConfig",
"params": {"bpPowerSoc": value,
"minChgSoc": 0,
"isConfig": value,
"minDsgSoc": 0}}),
]

def selects(self, client: EcoflowMQTTClient) -> list[BaseSelectEntity]:
return [
Expand Down
4 changes: 2 additions & 2 deletions custom_components/ecoflow_cloud/devices/river2_max.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ def switches(self, client: EcoflowMQTTClient) -> list[BaseSwitchEntity]:

EnabledEntity(client, "pd.bpPowerSoc", const.BP_ENABLED,
lambda value, params: {"moduleType": 1, "operateType": "watthConfig",
"params": {"isConfig": int(value),
"bpPowerSoc": int(params.get("pd.bpPowerSoc", 0)),
"params": {"isConfig": value,
"bpPowerSoc": value,
"minDsgSoc": 0,
"minChgSoc": 0}})
]
Expand Down

0 comments on commit 50e56ee

Please sign in to comment.