Skip to content

Allow using query parameters via the "target" key - #9

Open
clau-bucur wants to merge 1 commit into
qrioniclabs:mainfrom
clau-bucur:main
Open

Allow using query parameters via the "target" key#9
clau-bucur wants to merge 1 commit into
qrioniclabs:mainfrom
clau-bucur:main

Conversation

@clau-bucur

Copy link
Copy Markdown

Allow using query parameters via the "target" key
Make "buffered" optional
Add some logging info

Allow using query parameters via the "target" key
Add some logging info
@clau-bucur

Copy link
Copy Markdown
Author

This allows to execute commands which are easier to maintain or extend.
An example:

- service: notify.mysql_command
  data:
    message: >
      DELETE sst FROM statistics_short_term sst INNER JOIN statistics_meta sm ON sm.id = sst.metadata_id WHERE DATEDIFF(CURDATE(), FROM_UNIXTIME(sst.created_ts)) > %s
      AND
      (
        sm.statistic_id LIKE %s
        OR sm.statistic_id LIKE %s
        OR sm.statistic_id LIKE %s
        OR sm.statistic_id LIKE %s
        OR sm.statistic_id IN (%s, %s, %s)
      )
    target:
      [
        90,
        'sensor.thermal_comfort_outside_%',
        'sensor.average_%_cpu_nuc',
        'sensor.history_%washer_cycles',
        'sensor.history_tv_%',
        'sensor.history_heating_shower',
        'sensor.history_heating_hot_water',
        'sensor.history_heating_hot_water_hourly',
      ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant