diff --git a/custom_components/apex/apex.py b/custom_components/apex/apex.py index dbc6b2e..38682ac 100644 --- a/custom_components/apex/apex.py +++ b/custom_components/apex/apex.py @@ -139,6 +139,7 @@ def config(self): if self.version == "old": result = {} + return result if self.sid is None: _LOGGER.debug("We are none") self.auth() diff --git a/custom_components/apex/manifest.json b/custom_components/apex/manifest.json index 75f76c9..5fe813d 100644 --- a/custom_components/apex/manifest.json +++ b/custom_components/apex/manifest.json @@ -4,7 +4,7 @@ "config_flow": true, "documentation": "https://github.com/itchannel/apex-ha", "issue_tracker": "https://github.com/itchannel/apex-ha/issues", - "version": "1.0.7", + "version": "1.0.8", "requirements": [], "ssdp": [], "zeroconf": [], diff --git a/custom_components/apex/sensor.py b/custom_components/apex/sensor.py index c1fd85a..195fc1d 100644 --- a/custom_components/apex/sensor.py +++ b/custom_components/apex/sensor.py @@ -80,11 +80,12 @@ def extra_state_attributes(self): @property def unit_of_measurement(self): - for value in self.coordinator.data["config"]["iconf"]: - if value["did"] == self.sensor["did"]: - if "range" in value["extra"]: - if value["extra"]["range"] in MEASUREMENTS: - return MEASUREMENTS[value["extra"]["range"]] + if "iconf" in self.coordinator.data["config"]: + for value in self.coordinator.data["config"]["iconf"]: + if value["did"] == self.sensor["did"]: + if "range" in value["extra"]: + if value["extra"]["range"] in MEASUREMENTS: + return MEASUREMENTS[value["extra"]["range"]] if self.sensor["type"] in SENSORS: if "measurement" in SENSORS[self.sensor["type"]]: return SENSORS[self.sensor["type"]]["measurement"] diff --git a/info.md b/info.md index 7ca1fc5..fe61b5c 100644 --- a/info.md +++ b/info.md @@ -1,4 +1,6 @@ ## **Changelog** +## Version 1.08 +- Bug fix for config error on old status.xml file ### Version 1.07 - Change naming scheme for entities to start with apex_ **Breaking change: This will create duplicate entities as the naming scheme has changed and any existing automations will need to be updated to the new format** - Add retrieval of measurements from Apex config e.g. temp probes report correct Celcius or Fahrenheit