Skip to content

Commit

Permalink
Changed pet weigh to Number:Mass kilogram
Browse files Browse the repository at this point in the history
Signed-off-by: Holger Eisold <kugelsicha@gmail.com>
  • Loading branch information
HerzScheisse committed Oct 28, 2019
1 parent 716101d commit b2dd94e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions bundles/org.openhab.binding.surepetcare/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Channel names in **bold** are read/write, everything else is read-only
| **location** | Text | The current location of the pet (0=unknown, 1=inside, 2=outside) |
| locationChanged | DateTime | The time when the location was last changed |
| locationChangedThrough | Text | The device name or username where the pet left/entered the house |
| weight | Number | The pet's weight |
| weight | Number:Mass | The pet's weight (in kilogram) |
| 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) |
Expand Down Expand Up @@ -270,7 +270,7 @@ String UR_1e_TagIdentifier "Pet Tag Identifier [%s]" (dgP
String UR_1e_Location "Pet Location [%s]" (dgPet) {channel="surepetcare:pet:bridge1:12345:location"}
DateTime UR_1e_LocationChanged "Pet Loc. Updated [%1$ta. %1$tH:%1$tM]" (dgPet) {channel="surepetcare:pet:bridge1:12345:locationChanged"}
String UR_1e_LocationThrough "Pet Entered / Left through [%s]" (dgPet) {channel="surepetcare:pet:bridge1:12345:locationChangedThrough"}
Number UR_1e_Weight "Pet Weight [%.1f kg]" (dgPet) {channel="surepetcare:pet:bridge1:12345:weight"}
Number:Mass UR_1e_Weight "Pet Weight [%.1f %unit%]" (dgPet) {channel="surepetcare:pet:bridge1:12345:weight"}
DateTime UR_1e_DateOfBirth "Pet Date of Birth [%1$td.%1$tm.%1$tY]" (dgPet) {channel="surepetcare:pet:bridge1:12345:dateOfBirth"}
// Pet Feeder Data
String UR_1e_Device "Device Name [%s]" (dgPet) {channel="surepetcare:pet:bridge1:12345:feederDevice"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ String UR_1e_TagIdentifier "Pet Tag Identifier [%s]" (dgP
String UR_1e_Location "Pet Location [%s]" (dgPet) {channel="surepetcare:pet:bridge1:12345:location"}
DateTime UR_1e_LocationChanged "Pet Loc. Updated [%1$ta. %1$tH:%1$tM]" (dgPet) {channel="surepetcare:pet:bridge1:12345:locationChanged"}
String UR_1e_LocationThrough "Pet Entered / Left through [%s]" (dgPet) {channel="surepetcare:pet:bridge1:12345:locationChangedThrough"}
Number UR_1e_Weight "Pet Weight [%.1f kg]" (dgPet) {channel="surepetcare:pet:bridge1:12345:weight"}
Number:Mass UR_1e_Weight "Pet Weight [%.1f %unit%]" (dgPet) {channel="surepetcare:pet:bridge1:12345:weight"}
DateTime UR_1e_DateOfBirth "Pet Date of Birth [%1$td.%1$tm.%1$tY]" (dgPet) {channel="surepetcare:pet:bridge1:12345:dateOfBirth"}
// Pet Feeder Data
String UR_1e_Device "Device Name [%s]" (dgPet) {channel="surepetcare:pet:bridge1:12345:feederDevice"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ protected void updateThing() {
}
ZonedDateTime dob = pet.getDateOfBirthAsZonedDateTime();
updateState(PET_CHANNEL_DATE_OF_BIRTH, dob == null ? UnDefType.UNDEF : new DateTimeType(dob));
updateState(PET_CHANNEL_WEIGHT,
pet.getWeight() == null ? UnDefType.UNDEF : new DecimalType(pet.getWeight()));
updateState(PET_CHANNEL_WEIGHT, pet.getWeight() == null ? UnDefType.UNDEF
: new QuantityType<Mass>(pet.getWeight(), SIUnits.KILOGRAM));
if (pet.getTagId() != null) {
SurePetcareTag tag = petcareAPI.getTag(pet.getTagId().toString());
if (tag != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,10 +420,10 @@
</channel-type>

<channel-type id="weightType">
<item-type>Number</item-type>
<item-type>Number:Mass</item-type>
<label>Pet Weight</label>
<description>The pet weight</description>
<state readOnly="true" pattern="%.1f kg"></state>
<state readOnly="true" pattern="%.1f %unit%"></state>
</channel-type>

<channel-type id="feederDeviceType">
Expand Down

0 comments on commit b2dd94e

Please sign in to comment.