mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-04-19 10:47:15 +00:00

* Migrate to Ruff for lint and format * Fix pylint issues * DBus property sets into normal awaitable methods * Fix tests relying on separate tasks in connect * Fixes from feedback
29 lines
677 B
Python
29 lines
677 B
Python
"""Mock of logind dbus service."""
|
|
|
|
from .base import DBusServiceMock, dbus_method
|
|
|
|
BUS_NAME = "org.freedesktop.login1"
|
|
|
|
|
|
def setup(object_path: str | None = None) -> DBusServiceMock:
|
|
"""Create dbus mock object."""
|
|
return Logind()
|
|
|
|
|
|
class Logind(DBusServiceMock):
|
|
"""Logind mock.
|
|
|
|
gdbus introspect --system --dest org.freedesktop.login1 --object-path /org/freedesktop/login1
|
|
"""
|
|
|
|
object_path = "/org/freedesktop/login1"
|
|
interface = "org.freedesktop.login1.Manager"
|
|
|
|
@dbus_method()
|
|
def Reboot(self, interactive: "b") -> None:
|
|
"""Reboot."""
|
|
|
|
@dbus_method()
|
|
def PowerOff(self, interactive: "b") -> None:
|
|
"""PowerOff."""
|