Skip to content

Commit

Permalink
Fixed issue with setting charge/discharge
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlesGillanders committed Nov 14, 2023
1 parent 37ea6ad commit b09250e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions custom_components/alphaess/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
entry.async_on_unload(entry.add_update_listener(update_listener))

async def async_battery_charge_handler(call):
await client.setbatterycharge(call.data.get('serial'), call.data.get('enabled'), call.data.get('cp1start'), call.data.get('cp1end'), call.data.get('cp2start'), call.data.get('cp2end'), call.data.get('chargestopsoc'))
await client.updateChargeConfigInfo(call.data.get('serial'), call.data.get('chargestopsoc'), int(call.data.get('enabled') == True), call.data.get('cp1end'), call.data.get('cp2end'), call.data.get('cp1start'), call.data.get('cp2start'))

async def async_battery_discharge_handler(call):
await client.setbatterydischarge(call.data.get('serial'), call.data.get('enabled'), call.data.get('dp1start'), call.data.get('dp1end'), call.data.get('dp2start'), call.data.get('dp2end'), call.data.get('dischargecutoffsoc'))
await client.updateDisChargeConfigInfo(call.data.get('serial'), call.data.get('dischargecutoffsoc'), int(call.data.get('enabled') == True), call.data.get('dp1end'), call.data.get('dp2end'), call.data.get('dp1start'), call.data.get('dp2start'))

hass.services.async_register(
DOMAIN, 'setbatterycharge', async_battery_charge_handler, SERVICE_BATTERY_CHARGE_SCHEMA)
Expand Down
4 changes: 2 additions & 2 deletions custom_components/alphaess/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"documentation": "https://github.com/CharlesGillanders/homeassistant-alphaESS",
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/CharlesGillanders/homeassistant-alphaESS/issues",
"requirements": ["alphaessopenapi==0.0.1"],
"version": "0.4.0"
"requirements": ["alphaessopenapi==0.0.3"],
"version": "0.4.1"
}

0 comments on commit b09250e

Please sign in to comment.