mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-18 22:56:31 +00:00
Update and rename power.py to control.py
This commit is contained in:
parent
2c0a68bd8f
commit
217c1acc62
@ -7,7 +7,7 @@ from ..exceptions import HostNotSupportedError
|
|||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class PowerControl(CoreSysAttributes):
|
class SystemControl(CoreSysAttributes):
|
||||||
"""Handle host power controls."""
|
"""Handle host power controls."""
|
||||||
|
|
||||||
def __init__(self, coresys):
|
def __init__(self, coresys):
|
||||||
@ -39,3 +39,9 @@ class PowerControl(CoreSysAttributes):
|
|||||||
await self.sys_core.shutdown()
|
await self.sys_core.shutdown()
|
||||||
finally:
|
finally:
|
||||||
await self.sys_dbus.systemd.power_off()
|
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()
|
Loading…
x
Reference in New Issue
Block a user