PythonScriptsPro
PythonScriptsPro copied to clipboard
Doesn't work for me inside docker
Hi, thank you for the great component. I'm running Home Assistant 2022.2.9 either 'core' or docker version. The following simple button
type: button
name: Reboot
show_state: false
tap_action:
action: call-service
service: python_script.exec
service_data:
title: RestartButton
source: |
import os
os.system('date')
target: {}
icon: mdi:restart
icon_height: 100px
hold_action:
action: call-service
service: python_script.exec
service_data:
title: RestartButton
source: |
import os
os.system('systemctl reboot -i')
target: {}
just work fine under core version but does anything under the docker version. Both installation are quite the same but the results are very different. On both log I can see:
'call_service', 'domain': 'python_script', 'service': 'exec', 'target': {}, 'service_data': {'title': 'RestartButton', 'source': "import os\nos.system('date')\n"}, 'id': 32}
2022-02-26 10:57:51 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=python_script, service=exec, service_data=title=RestartButton, source=import os
os.system('date')
>
2022-02-26 10:57:51 DEBUG (SyncWorker_3) [custom_components.python_script] Load inline code
2022-02-26 10:57:51 DEBUG (SyncWorker_3) [custom_components.python_script] Run python script
The result sab 26 feb 2022, 10:57:51, CET is only visible under the core version log.
Could you help me to understand what's happening? regards