From 95aaf1d7174d4143eb8ff58aa4aba90b12659200 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20Andr=C3=A9=20Eisold?= Date: Tue, 14 Jan 2025 20:52:29 +0100 Subject: [PATCH] [surepetcare] API change pet weight (#18105) * API seems to be changed at some point... the weight is now in gram not in kilogram anymore Signed-off-by: Holger Eisold --- bundles/org.openhab.binding.surepetcare/README.md | 2 +- .../surepetcare/internal/handler/SurePetcarePetHandler.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.binding.surepetcare/README.md b/bundles/org.openhab.binding.surepetcare/README.md index 4ac46ebad6fef..7667b5f233bb3 100644 --- a/bundles/org.openhab.binding.surepetcare/README.md +++ b/bundles/org.openhab.binding.surepetcare/README.md @@ -139,7 +139,7 @@ Channel names in **bold** are read/write, everything else is read-only | locationChanged | DateTime | The time when the location was last changed | | locationTimeoffset | String | Time-Command to set the pet location with a time offset. (10, 30 or 60 minutes ago) | | locationChangedThrough | Text | The device name or username where the pet left/entered the house | -| weight | Number:Mass | The pet's weight (in kilogram) | +| weight | Number:Mass | The pet's weight (in gram) | | dateOfBirth | DateTime | The pet's date of birth | | feederDevice | Text | The device from which the pet last ate | | feederLastChange | Number:Mass | The last eaten change in gram (big bowl) | diff --git a/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/handler/SurePetcarePetHandler.java b/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/handler/SurePetcarePetHandler.java index 5873bde18af28..f23de631a926c 100644 --- a/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/handler/SurePetcarePetHandler.java +++ b/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/handler/SurePetcarePetHandler.java @@ -181,7 +181,7 @@ protected void updateThing() { updateState(PET_CHANNEL_DATE_OF_BIRTH, pet.dateOfBirth == null ? UnDefType.UNDEF : new DateTimeType(pet.dateOfBirth.atStartOfDay(ZoneId.systemDefault()))); updateState(PET_CHANNEL_WEIGHT, - pet.weight == null ? UnDefType.UNDEF : new QuantityType<>(pet.weight, SIUnits.KILOGRAM)); + pet.weight == null ? UnDefType.UNDEF : new QuantityType<>(pet.weight, SIUnits.GRAM)); if (pet.tagId != null) { SurePetcareTag tag = petcareAPI.getTag(pet.tagId.toString()); if (tag != null) {