Skip to content
This repository was archived by the owner on Feb 3, 2025. It is now read-only.

Add expiry configuration setting to exclude old messages#23

Open
NateRobinsonS wants to merge 2 commits into
isabellaalstrom:masterfrom
NateRobinsonS:master
Open

Add expiry configuration setting to exclude old messages#23
NateRobinsonS wants to merge 2 commits into
isabellaalstrom:masterfrom
NateRobinsonS:master

Conversation

@NateRobinsonS
Copy link
Copy Markdown
Contributor

Added an expiry setting in the config file to allow older messages to be dropped from the sensor after a configureable amount of time. Messages from krisinformation's API that are older than this setting will be excluded from the sensor.

Note: I was unable to make this an optional setting in the configuration file. Omitting the "expiry" setting causes the config_check to fail. I suspect that the cv.time_period_dict type cannot be optional. As a result, the proposed upgrade is a breaking change!

Example configuration:

sensor:
  - platform: krisinformation
    latitude: !secret lat_coord
    longitude: !secret long_coord
    county: 'Stockholms län'
    radius: 100
    expiry:
      days: 2 

Update manifest.json to require jsonpath package (isabellaalstrom#21)
Added an "expiry" setting in the config file.  Messages that are older than this setting will be excluded from the sensor.

Note: I was unable to make this an optional setting.  I suspect that the cv.time_period_dict type cannot be optional.  

This makes the proposed upgrade a breaking change!
@isabellaalstrom
Copy link
Copy Markdown
Owner

I want to try this out before merging, due to the breaking change. I will do that as soon as I have the time.

@NateRobinsonS
Copy link
Copy Markdown
Contributor Author

NateRobinsonS commented Apr 6, 2020 via email

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants