OpenEPaperLink / Home_Assistant_Integration

Home assistant Integration for the OpenEPaperLink project
Apache License 2.0
132 stars 33 forks source link

Resend image after ttl has passed #138

Closed baschi29 closed 2 months ago

baschi29 commented 2 months ago

Is your feature request related to a problem? Please describe. Currently setting the ttl of an image only happens to affect the tag until its next checkin. After that the tag falls back to the default checkin time again. The problem is described in more detail in the open e paper link git under https://github.com/jjwbruijn/OpenEPaperLink/issues/290

The open e paper link issue got closed with the following and in my opinion understandable remarks:

The checking in time is by design: with setting the TTL during upload, you tell the AP that the image is valid for at least that time. After the time runs out, the check falls back to the default, because the tag can expect a few image shortly. If, at that point, you are sure that the image is valid for a certain time again, you can push the same image with a new TTL. ( if you push the same image, the tag will not transfer the image, and will not refresh).

However, while using home assistant it is unlikely that this behavior is intended by the user when specifying the ttl in the service call as it is indeed not clear that the tag can expect a new image shortly after the ttl expires.

Describe the solution you'd like I would have expected that the tag remembers the ttl specified in the service call. With regards to the upstream remarks that would mean resending the same image to the access point in intervals specified by the ttl which in turn would comply to the open e paper link behavior of the tag expecting a new image shortly after.

Describe alternatives you've considered As this new behavior the ttl specified in the service call wouldn't closely match the open e paper link ttl anymore maybe adding this behavior as a new option/parameter could be reasonable to avoid further confusion.

Also, I'm aware that one could also execute a script with the corresponding service call at intervals given by the ttl in them as a workaround. However, in my opinion this would be the inferior choice as it has the possibility to unnecessarily cause lots of very simple/redundant scripts when using multiple tags with home assistant.

baschi29 commented 2 months ago

After further thinking I came to the conclusion that the best idea is probably to just inform the user about the functionality of the TTL parameter as is. I may open a pull request later.