Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

database: database_maxage might remove all stored values from item #598

Closed
bmxp opened this issue Apr 10, 2022 · 3 comments
Closed

database: database_maxage might remove all stored values from item #598

bmxp opened this issue Apr 10, 2022 · 3 comments
Milestone

Comments

@bmxp
Copy link
Member

bmxp commented Apr 10, 2022

Consider the following item:

Solltemperatur:
    type: num
    cache: True

The database plugin should drop in here to remove cache: True attribute thus the item is changed to:

Solltemperatur:
    type: num
    database: init
    database_maxage: 7

In case there is not much of change - let's assume no change for the last 14 days, then the attribute database_maxage: 7 will ensure that all data for this item is removed after 7 days.
But when restarting SmartHomeNG after 7 days, this will lead to a missing init value for the item since all database entries are already deleted.

A fix should be provided that ensures that at least the last data entry to the database is kept to provide an init value for a later restart of SmartHomeNG

@bmxp
Copy link
Member Author

bmxp commented Nov 4, 2022

This should be fixed as of release 1.9.3.

Please test and report if there are conditions when this leads to problems

@msinn msinn added this to the Version 1.10 milestone Mar 9, 2023
@msinn
Copy link
Member

msinn commented Aug 29, 2023

@bmxp Was this fixed in v1.9.3?

@msinn msinn changed the title database plugin: database_maxage might remove all stored values from item database: database_maxage might remove all stored values from item Aug 29, 2023
@aschwith
Copy link
Contributor

Tested the implementations made in the database plugin (tested with V1.10 although the adaptations were made longtime before). Issue is fixed. Ticket can be closed.

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

No branches or pull requests

3 participants