]> git.basschouten.com Git - openhab-addons.git/commit
[jpa] Fix restoring quantity types (#17215)
authorCody Cutrer <cody@cutrer.us>
Tue, 20 Aug 2024 13:27:52 +0000 (07:27 -0600)
committerGitHub <noreply@github.com>
Tue, 20 Aug 2024 13:27:52 +0000 (15:27 +0200)
commitbe0ad1cdce5d7b09f1178a70645ed99b9a3b513a
treec516a7b27c392fe36041bbfd191dffc1413389ae
parent02252627fd19a7e0c6bbb781d9d4e6dce1fbba7c
[jpa] Fix restoring quantity types (#17215)

* [jpa] Fix restoring quantity types

Double.parseDouble throws NumberFormatException if the persisted state
includes a unit. So parse it as a QuantityType, and then apply unit
conversions as necessary.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
bundles/org.openhab.persistence.jpa/src/main/java/org/openhab/persistence/jpa/internal/JpaHistoricItem.java