1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2025-12-24 20:35:55 +00:00

Update info.py

This commit is contained in:
Pascal Vizeli
2018-04-26 11:32:15 +02:00
committed by GitHub
parent a59245e6bb
commit 94fba7e175

View File

@@ -42,16 +42,8 @@ class InfoCenter(CoreSysAttributes):
"""Return local CPE."""
return self._data.get('OperatingSystemCPEName', UNKNOWN)
def _check_dbus_hostname(self):
"""Check if systemd is connect or raise error."""
if not self.sys_dbus.hostname.is_connected:
_LOGGER.error("No hostname dbus connection available")
raise HostNotSupportedError()
async def update(self):
"""Update properties over dbus."""
self._check_dbus_hostname()
_LOGGER.info("Update local host information")
try:
self._data = await self.sys_dbus.hostname.get_properties()