Skip to content

Commit a7f19fb

Browse files
committed
async revert
1 parent 3504aba commit a7f19fb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

appdaemon/adbase.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
from typing import TYPE_CHECKING
66

77
from appdaemon import adapi
8+
from appdaemon import utils
89
from appdaemon.models.config.app import AppConfig
9-
from appdaemon.utils import StateAttrs
10+
1011

1112
# Check if the module is being imported using the legacy method
1213
if __name__ == Path(__file__).name:
@@ -31,7 +32,7 @@ def __init__(self):
3132
pass
3233

3334
def __get__(self, instance, owner):
34-
stateattrs = StateAttrs(instance.get_state())
35+
stateattrs = utils.StateAttrs(instance.get_state())
3536
return stateattrs
3637

3738

@@ -165,7 +166,8 @@ def name(self) -> str:
165166
def get_ad_api(self) -> adapi.ADAPI:
166167
return adapi.ADAPI(self.AD, self.config_model)
167168

168-
def get_plugin_api(self, plugin_name: str):
169+
@utils.sync_decorator
170+
async def get_plugin_api(self, plugin_name: str):
169171
"""Get the plugin API for a specific plugin."""
170172
if isinstance(cfg := self.app_config.root.get(self.name), AppConfig):
171173
return self.AD.plugins.get_plugin_api(plugin_name, cfg)

0 commit comments

Comments
 (0)