diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json index 5b57593..7a9e46c 100644 --- a/.vs/VSWorkspaceState.json +++ b/.vs/VSWorkspaceState.json @@ -1,10 +1,9 @@ { "ExpandedNodes": [ "", - "\\.github\\workflows", "\\custom_components", "\\custom_components\\climate_ip" ], - "SelectedNode": "\\custom_components\\climate_ip\\manifest.json", + "SelectedNode": "\\custom_components\\climate_ip\\climate.py", "PreviewInSolutionExplorer": false } \ No newline at end of file diff --git a/.vs/samsungrac/FileContentIndex/ada6588c-90a8-4a15-83fa-7a436c704eed.vsidx b/.vs/samsungrac/FileContentIndex/b8db487f-3389-44f0-b3f4-0bd13aab934b.vsidx similarity index 100% rename from .vs/samsungrac/FileContentIndex/ada6588c-90a8-4a15-83fa-7a436c704eed.vsidx rename to .vs/samsungrac/FileContentIndex/b8db487f-3389-44f0-b3f4-0bd13aab934b.vsidx diff --git a/.vs/samsungrac/v17/.wsuo b/.vs/samsungrac/v17/.wsuo index bffc07d..5a1ef8e 100644 Binary files a/.vs/samsungrac/v17/.wsuo and b/.vs/samsungrac/v17/.wsuo differ diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite index 7f4fd0c..3c805ab 100644 Binary files a/.vs/slnx.sqlite and b/.vs/slnx.sqlite differ diff --git a/custom_components/climate_ip/climate.py b/custom_components/climate_ip/climate.py index 4febd9f..9fa9b38 100755 --- a/custom_components/climate_ip/climate.py +++ b/custom_components/climate_ip/climate.py @@ -194,7 +194,8 @@ def __init__(self, rac_controller, config): _LOGGER.info("self._name: {}".format(self._name)) self._poll = None - self._unique_id = None + self._unique_id = self._name + _LOGGER.info("self._unique_id: {}".format(self._unique_id)) str_poll = config.get(CONFIG_DEVICE_POLL, "") if str_poll: str_poll = str_poll.lower() @@ -255,11 +256,10 @@ def unique_id(self): # self._unique_id = "climate_ip_" + self.rac.unique_id if self._unique_id is None: - name_value = self._name #config.get(CONF_MAC, None) #self._cfg.duid + name_value = self._name _LOGGER.info("About to set unique id {}".format(name_value)) self._unique_id = "climate_ip_" + name_value - _LOGGER.info("Returning unique id of {}".format(self._unique_id)) return self._unique_id diff --git a/custom_components/climate_ip/controller_yaml.py b/custom_components/climate_ip/controller_yaml.py index 2d02f4d..fe23f4e 100755 --- a/custom_components/climate_ip/controller_yaml.py +++ b/custom_components/climate_ip/controller_yaml.py @@ -95,7 +95,7 @@ def __init__(self, config, logger): self._retries_count = 0 self._last_device_state = None self._poll = None - self._unique_id = None + self._unique_id = self._device_id self._uniqe_id_prop = None @property @@ -275,7 +275,9 @@ def update_state(self): self._attributes['AC_ADD2_OPTIONCODE'] = json_data['AC_ADD2_OPTIONCODE'] self._attributes['AC_ADD2_USEDTIME'] = json_data['AC_ADD2_USEDTIME'] self._attributes['AC_ADD2_FILTER_USE_TIME'] = json_data['AC_ADD2_FILTER_USE_TIME'] - self._attributes['last_sync'] = datetime.now().strftime("%Y-%m-%d %H:%M:%S") + + if(len(json_data['AC_ADD2_OUT_VERSION']) != 0): + self._attributes['last_sync'] = datetime.now().strftime("%Y-%m-%d %H:%M:%S") except: self._logger.info("Error: update_state")