diff --git a/supervisor/homeassistant/__init__.py b/supervisor/homeassistant/__init__.py index 6471186d6..cd177cf4f 100644 --- a/supervisor/homeassistant/__init__.py +++ b/supervisor/homeassistant/__init__.py @@ -230,7 +230,7 @@ class HomeAssistant(FileConfiguration, CoreSysAttributes): def need_update(self) -> bool: """Return true if a Home Assistant update is available.""" try: - return self.version != self.latest_version + return self.version < self.latest_version except (AwesomeVersionException, TypeError): return False diff --git a/supervisor/updater.py b/supervisor/updater.py index e0e22b267..ea9697c78 100644 --- a/supervisor/updater.py +++ b/supervisor/updater.py @@ -230,6 +230,7 @@ class Updater(FileConfiguration, CoreSysAttributes): if not data or data.get(ATTR_CHANNEL) != self.channel: raise UpdaterError(f"Invalid data from {url}", _LOGGER.warning) + events = ["supervisor", "core"] try: # Update supervisor version self._data[ATTR_SUPERVISOR] = AwesomeVersion(data["supervisor"]) @@ -241,6 +242,7 @@ class Updater(FileConfiguration, CoreSysAttributes): # Update HassOS version if self.sys_hassos.board: + events.append("os") self._data[ATTR_HASSOS] = AwesomeVersion( data["hassos"][self.sys_hassos.board] ) @@ -267,5 +269,8 @@ class Updater(FileConfiguration, CoreSysAttributes): f"Can't process version data: {err}", _LOGGER.warning ) from err - else: - self.save_data() + self.save_data() + + # Send status update to core + for event in events: + self.sys_homeassistant.websocket.supervisor_update_event(event)