diff --git a/custom_components/evcc_intg/__init__.py b/custom_components/evcc_intg/__init__.py index 5aac0f6..45472bb 100644 --- a/custom_components/evcc_intg/__init__.py +++ b/custom_components/evcc_intg/__init__.py @@ -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 } diff --git a/custom_components/evcc_intg/config_flow.py b/custom_components/evcc_intg/config_flow.py index a9636de..f96af31 100644 --- a/custom_components/evcc_intg/config_flow.py +++ b/custom_components/evcc_intg/config_flow.py @@ -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: @@ -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) diff --git a/custom_components/evcc_intg/manifest.json b/custom_components/evcc_intg/manifest.json index 240498d..5aeeb6c 100644 --- a/custom_components/evcc_intg/manifest.json +++ b/custom_components/evcc_intg/manifest.json @@ -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" }