Support relational operators in event hook filters #253

Closed
opened 2023-04-27 02:18:26 +02:00 by blacklight · 0 comments
Owner

For example, to trigger a hook when an EntityUpdateEvent is received with value > 25:

from platypush.event.hook import hook
from platypush.message.event.entities import EntityUpdateEvent


@hook(EntityUpdateEvent, entity={
    "external_id": "my-sensor:temperature",
    "value": {
        "$gt": 25
    }
}):
    ...

The operators syntax is inspired by that of the ElasticSearch JSON queries.

For example, to trigger a hook when an `EntityUpdateEvent` is received with `value > 25`: ```python from platypush.event.hook import hook from platypush.message.event.entities import EntityUpdateEvent @hook(EntityUpdateEvent, entity={ "external_id": "my-sensor:temperature", "value": { "$gt": 25 } }): ... ``` The operators syntax is inspired by that of the ElasticSearch JSON queries.
blacklight added the
new feature
label 2023-04-27 02:18:39 +02:00
blacklight added this to the core project 2023-04-27 02:19:09 +02:00
blacklight self-assigned this 2023-04-27 02:19:12 +02:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: platypush/platypush#253
No description provided.