File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 55from typing import TYPE_CHECKING
66
77from appdaemon import adapi
8+ from appdaemon import utils
89from 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
1213if __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 )
You can’t perform that action at this time.
0 commit comments