Log if board reported by HAOS isn't in version file (#3366)

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
This commit is contained in:
Stefan Agner 2021-12-15 16:45:18 +01:00 committed by GitHub
parent 5503f93a75
commit 5b96074055
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 4 deletions

View File

@ -242,11 +242,15 @@ class Updater(FileConfiguration, CoreSysAttributes):
# Update HassOS version
if self.sys_os.board:
events.append("os")
self._data[ATTR_HASSOS] = AwesomeVersion(
data["hassos"][self.sys_os.board]
)
self._data[ATTR_OTA] = data["ota"]
if version := data["hassos"].get(self.sys_os.board):
events.append("os")
self._data[ATTR_HASSOS] = AwesomeVersion(version)
else:
_LOGGER.warning(
"Board '%s' not found in version file. No OS updates.",
self.sys_os.board,
)
# Update Home Assistant plugins
self._data[ATTR_CLI] = AwesomeVersion(data["cli"])