Commit e66736f 1 parent ad0ef0e commit e66736f Copy full SHA for e66736f
File tree 2 files changed +6
-5
lines changed
custom_components/zha_toolkit
2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -652,12 +652,12 @@ async def async_setup(hass, config):
652
652
return True
653
653
654
654
LOGGER .debug ("Setup services from async_setup" )
655
- await register_services ( hass )
655
+ await hass . async_add_executor_job ( register_services , hass )
656
656
657
657
return True
658
658
659
659
660
- async def register_services (hass ): # noqa: C901
660
+ def register_services (hass ): # noqa: C901
661
661
global LOADED_VERSION # pylint: disable=global-statement
662
662
hass_ref = hass
663
663
@@ -705,7 +705,8 @@ async def toolkit_service(service):
705
705
LOGGER .debug ("module is %s" , module )
706
706
importlib .reload (u )
707
707
708
- if await u .getVersion () != LOADED_VERSION :
708
+ currentVersion = hass .async_add_executor_job (u .getVersion )
709
+ if currentVersion != LOADED_VERSION :
709
710
LOGGER .debug (
710
711
"Reload services because VERSION changed from %s to %s" ,
711
712
LOADED_VERSION ,
@@ -859,7 +860,7 @@ async def toolkit_service(service):
859
860
schema = value ,
860
861
)
861
862
862
- LOADED_VERSION = await u .getVersion ()
863
+ LOADED_VERSION = u .getVersion ()
863
864
864
865
865
866
async def command_handler_default (
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ def getZigpyVersion() -> str:
54
54
return ZIGPY_VERSION
55
55
56
56
57
- async def getVersion () -> str :
57
+ def getVersion () -> str :
58
58
# pylint: disable=global-variable-undefined,used-before-assignment
59
59
# pylint: disable=global-statement
60
60
global VERSION_TIME
You can’t perform that action at this time.
0 commit comments