diff --git a/hassio/host/power.py b/hassio/host/control.py similarity index 79% rename from hassio/host/power.py rename to hassio/host/control.py index f620e15b2..b17f8da84 100644 --- a/hassio/host/power.py +++ b/hassio/host/control.py @@ -7,7 +7,7 @@ from ..exceptions import HostNotSupportedError _LOGGER = logging.getLogger(__name__) -class PowerControl(CoreSysAttributes): +class SystemControl(CoreSysAttributes): """Handle host power controls.""" def __init__(self, coresys): @@ -39,3 +39,9 @@ class PowerControl(CoreSysAttributes): await self.sys_core.shutdown() finally: await self.sys_dbus.systemd.power_off() + + async def set_hostname(self, hostname): + """Set local a new Hostname.""" + _LOGGER.info("Set Hostname %s", hostname) + await self.sys_dbus.hostname.set_hostname(hostname) + await self.sys_host.info.update()