Fix issue generic (#1422)

* Fix issue on generic

* Fix style
This commit is contained in:
Pascal Vizeli 2020-01-08 23:52:26 +01:00 committed by GitHub
parent 899b17e992
commit 7c790dbbd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -112,13 +112,13 @@ class HassOS(CoreSysAttributes):
async def load(self) -> None:
"""Load HassOS data."""
try:
if self.sys_host.info.cpe is None:
raise TypeError()
cpe = CPE(self.sys_host.info.cpe)
if not self.sys_host.info.cpe:
raise NotImplementedError()
cpe = CPE(self.sys_host.info.cpe)
if cpe.get_product()[0] != "hassos":
raise TypeError()
except TypeError:
raise NotImplementedError()
except NotImplementedError:
_LOGGER.debug("Found no HassOS")
return
else: