sensor:
#执行代码
- platform: command_line
#command: python3 -c "import requests; print(requests.get('https://pypi.python.org/pypi/homeassistant/json').json()['info']['version'])"
command: python3 -c "print('hello')"
name: HA release
docker 下路径:
不加任何路径直接写py文件名,则需要把py文件放到configuration.yaml同目录下
参考:
https://www.home-assistant.io/integrations/command_line