This is a cleanup only and does not change functionality when openhab/openhab-core#3583 has first been merged. The core PR discards time-zone from DateTimeType, thus binding code can be simplified:
Instantiations from ZonedDateTime using either time-zone from TimeZoneProvider or ZoneId.systemDefault() have been simplified to use Instant. In some cases this entirely eliminated the need for TimeZoneProvider, which has then been removed.
Usages of deprecated methods toZone and toLocaleZone have been removed.
Usages of method getZonedDateTime have been removed. In cases where time-zone is needed, getInstant().atZone(ZoneId.systemDefault()) is now explicitly called.
This is a cleanup only and does not change functionality when openhab/openhab-core#3583 has first been merged. The core PR discards time-zone from
DateTimeType
, thus binding code can be simplified:ZonedDateTime
using either time-zone fromTimeZoneProvider
orZoneId.systemDefault()
have been simplified to useInstant
. In some cases this entirely eliminated the need forTimeZoneProvider
, which has then been removed.toZone
andtoLocaleZone
have been removed.getZonedDateTime
have been removed. In cases where time-zone is needed,getInstant().atZone(ZoneId.systemDefault())
is now explicitly called.Related to openhab/openhab-core#3583