forked from platypush/platypush
Fabio Manganiello
245472a4c5
- Support for nested attributes on event hook conditions. Things like these are now possible: ``` from platypush.event.hook import hook from platypush.message.event.entities import EntityUpdateEvent @hook(EntityUpdateEvent, entity={"external_id": "system:cpu"}) def on_cpu_update_event(event: EntityUpdateEvent, **_): print(event.args["entity"]["percent"]) ``` - The scoring/regex extraction/partial string match logic in `_matches_argument` is actually only needed for `SpeechRecognizedEvent`. Other events don't need these features, and event hooks may be actually triggered unexpectedly in case of partial matches. Therefore, the "complex" `_matches_argument` has been moved as an override only for `SpeechRecognizedEvent`, and all the other events will perform simple key-value matching. |
||
---|---|---|
.. | ||
etc | ||
__init__.py | ||
__main__.py | ||
conftest.py | ||
test_cron.py | ||
test_event_parse.py | ||
test_http.py | ||
test_procedure.py | ||
utils.py |