mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-27 02:56:31 +00:00
fix dbus
This commit is contained in:
parent
2b2f3214e9
commit
82f68b4a7b
@ -5,10 +5,10 @@ from ..exceptions import DBusNotConnectedError
|
|||||||
|
|
||||||
def dbus_connected(method):
|
def dbus_connected(method):
|
||||||
"""Wrapper for check if dbus is connected."""
|
"""Wrapper for check if dbus is connected."""
|
||||||
def wrap_dbus(self, *args, **kwargs):
|
def wrap_dbus(api, *args, **kwargs):
|
||||||
"""Check if dbus is connected before call a method."""
|
"""Check if dbus is connected before call a method."""
|
||||||
if self.dbus is None:
|
if api.dbus is None:
|
||||||
raise DBusNotConnectedError(f"{self!s} not connected to dbus!")
|
raise DBusNotConnectedError(f"{api!s} not connected to dbus!")
|
||||||
return self.method(*args, **kwargs)
|
return method(api, *args, **kwargs)
|
||||||
|
|
||||||
return wrap_dbus
|
return wrap_dbus
|
||||||
|
Loading…
x
Reference in New Issue
Block a user