Skip to content

Commit

Permalink
fixing #62 & #63
Browse files Browse the repository at this point in the history
  • Loading branch information
marq24 committed Jan 8, 2025
1 parent b8b5601 commit 29fee5a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
10 changes: 9 additions & 1 deletion custom_components/evcc_intg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,18 @@ async def read_evcc_config_on_startup(self):
self._loadpoint = {}
api_index = 1
for a_loadpoint in initdata[JSONKEY_LOADPOINTS]:
phaseSwitching = False
if "chargerPhases1p3p" in a_loadpoint:
phaseSwitching = a_loadpoint["chargerPhases1p3p"]
elif "chargerPhaseSwitching" in a_loadpoint:
phaseSwitching = a_loadpoint["chargerPhaseSwitching"]
else:
phaseSwitching = False

self._loadpoint[f"{api_index}"] = {
"name": a_loadpoint["title"],
"id": slugify(a_loadpoint["title"]),
"has_phase_auto_option": a_loadpoint["chargerPhases1p3p"],
"has_phase_auto_option": phaseSwitching,
"vehicle_key": a_loadpoint["vehicleName"],
"obj": a_loadpoint
}
Expand Down
4 changes: 2 additions & 2 deletions custom_components/evcc_intg/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def async_get_options_flow(config_entry):
class EvccOptionsFlowHandler(config_entries.OptionsFlow):
def __init__(self, config_entry):
"""Initialize HACS options flow."""
self.config_entry = config_entry
self._title = config_entry.title
if len(dict(config_entry.options)) == 0:
self.options = dict(config_entry.data)
else:
Expand All @@ -119,4 +119,4 @@ async def async_step_user(self, user_input=None):
)

async def _update_options(self):
return self.async_create_entry(title=self.config_entry.title, data=self.options)
return self.async_create_entry(title=self._title, data=self.options)
2 changes: 1 addition & 1 deletion custom_components/evcc_intg/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"iot_class": "local_polling",
"issue_tracker": "https://github.com/marq24/ha-evcc/issues",
"requirements": [],
"version": "2025.1.1"
"version": "2025.1.2"
}

0 comments on commit 29fee5a

Please sign in to comment.