sensor.krisinformation
sensor.krisinformation copied to clipboard
Add `expiry` configuration setting to exclude old messages
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
I want to try this out before merging, due to the breaking change. I will do that as soon as I have the time.
I strongly agree, and there's no rush. I only have one system to test on.
I won't take it personally if you choose not to use it. :)
-Nate
On Mon, Apr 6, 2020 at 9:54 AM Isabella Gross Alström < [email protected]> wrote:
I want to try this out before merging, due to the breaking change. I will do that as soon as I have the time.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/isabellaalstrom/sensor.krisinformation/pull/23#issuecomment-609635156, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF7XJUBSA2OBMH6APNJZXR3RLGDEZANCNFSM4LWOHHMA .