Là một dự án mã nguồn mở, AlexxIT/PythonScriptsPro đã đạt 149 sao trên GitHub, ngôn ngữ Python. Advanced version of python scripts for Home Assistant without limits
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Method 2. Manually copy python_script folder from latest release to custom_components folder.
Configuration
Important: The component replaces the standard python_script component!
Add to configuration.yaml:
python_script: # no S at the end!
If you need to use additional python libraries, the component can install them:
python_script:
requirements:
- paramiko>=2.7.1
Use python_script.exec service
The component creates the python_script.exec service.
You can run an external python script located in any folder (use file param).
Or you can paste python source code directly into your YAML (use source param).
You can import and use any library in your python scripts. The standard python_script component does not allow this.
You can pass any variables to your script, just like in the standard python_script.
The component compile and caches the executable code for faster next launch. If you want change python file without reload HA, you can disable cache with the cache: false param.
Starting from Home Assistant 2023.7 the service will return all your script local vars with simple types as respond.
The following variables are available in the script:
hass - The Home Assistant API
data - The data passed to the Python Script service call
logger - A logger to allow you to log messages
Run script from python file
Show Home Assistant start time in Notification. Using my another component StartTime. Pass variable to script.
script:
test_file:
sequence:
- service: python_script.exec
data_template: # use `data_template` if you have Jinja2 templates in params
file: path_to/test_file.py # relative path from config folder
cache: false # disable cache if you want change python file without reload HA
title: Python from file test
time_val: "{{ states('sensor.start_time')|round }}"
test_file.py
logger.debug(data)
hass.services.call('persistent_notification', 'create', {
'title': data['title'],
'message': f"Home Assistant starts in { data['time_val'] } seconds"
})
out1 = 123 # some var for service respond
Run script from inline source
Show your IP address in Notification. Using requests library. It is installed by default with Home Assistant.
AlexxIT/PythonScriptsPro có 149 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/AlexxIT/PythonScriptsPro. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
AlexxIT/PythonScriptsPro có phải mã nguồn mở không?
TopGit chưa ghi nhận license cho AlexxIT/PythonScriptsPro. Phần lớn repo public trên GitHub là mã nguồn mở, nhưng điều khoản khác nhau từng repo — mở file LICENSE để xác nhận.
AlexxIT/PythonScriptsPro còn đang phát triển không?
Commit gần nhất trên AlexxIT/PythonScriptsPro là 4 tháng trước (theo timestamp GitHub). Repo có 17 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
AlexxIT/PythonScriptsPro là gì?
AlexxIT/PythonScriptsPro (AlexxIT/PythonScriptsPro) là dự án Python trên GitHub. Theo mô tả gốc: Advanced version of python scripts for Home Assistant without limits
AlexxIT/PythonScriptsPro viết bằng ngôn ngữ gì?
AlexxIT/PythonScriptsPro chủ yếu viết bằng Python. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc thêm về AlexxIT/PythonScriptsPro ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/AlexxIT/PythonScriptsPro là nguồn chính thức.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về PythonScriptsPro?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về PythonScriptsPro.