Skip to content

Commit 6e9a6ff

Browse files
committed
Fix import scripts from main script #23
1 parent 3ddcf59 commit 6e9a6ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

custom_components/python_script/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def handler(call: ServiceCall) -> ServiceResponse:
101101
def execute_script(hass: HomeAssistant, data: dict, logger, code) -> ServiceResponse:
102102
try:
103103
_LOGGER.debug("Run python script")
104-
exec(code, locals())
104+
exec(code, {**globals(), **locals()})
105105
response = {
106106
k: v
107107
for k, v in locals().items()

0 commit comments

Comments
 (0)