openhab / openhab-core

Core framework of openHAB
https://www.openhab.org/
Eclipse Public License 2.0
932 stars 429 forks source link

Extend HistoricItem to work with Instant instead of ZonedDateTime #4384

Closed joerg1985 closed 1 month ago

joerg1985 commented 2 months ago

This PR will add a new default method to the HistoricItem interface, to get the timestamp as Instant. The most areas using the HistoricItem must transform the internal Instant to a ZonedDateTime (e.g. all the persistence implementations) or need to transform the returned ZonedDateTime to an Instant (e.g. see the below).

So i my mind it does make sense to use a Instant here and not transform the data. The link to the persistence implementations above does show the changes needed to the addons.

Signed-off-by: Jörg Sautter joerg.sautter@gmx.net

rkoshak commented 2 months ago

Will this be a breaking change for rules which currently expect a ZonedDateTime?

joerg1985 commented 2 months ago

@rkoshak no this is a none breaking change, the new method has a default implementation and all old methods are still in place.