mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
New component: Python Script (#7950)
* Add initial version
* Fix requirements
* Prefer logging over printing
* Set executor thread name on >Py36 only
* Add tests
* Lint
* Add restrictedpython to test dependencies
* Create python_script.py
From doc:
```
However, an empty dict ({}) is treated as is. If you want to specify a list that can contain anything, specify it as dict:
>>> schema = Schema({}, extra=ALLOW_EXTRA) # don't do this
>>> try:
... schema({'extra': 1})
... raise AssertionError('MultipleInvalid not raised')
... except MultipleInvalid as e:
... exc = e
>>> str(exc) == "not a valid value"
True
>>> schema({})
{}
>>> schema = Schema(dict) # do this instead
>>> schema({})
{}
>>> schema({'extra': 1})
{'extra': 1}
```
This commit is contained in:
committed by
Pascal Vizeli
parent
640c692e1f
commit
db0efc647d
@@ -65,6 +65,7 @@ TEST_REQUIREMENTS = (
|
||||
'gTTS-token',
|
||||
'pywebpush',
|
||||
'PyJWT',
|
||||
'restrictedpython',
|
||||
)
|
||||
|
||||
IGNORE_PACKAGES = (
|
||||
|
||||
Reference in New Issue
Block a user