From ef7f70d93d7700ed41004cd271038e4d9cba344c Mon Sep 17 00:00:00 2001 From: Cody Cutrer Date: Fri, 7 Oct 2022 15:24:07 -0600 Subject: [PATCH 1/2] [homekit] allow configuring maxValue on VOCDensity the default of 1000 is quite low in reality. tested and confirmed working with iOS 16 Signed-off-by: Cody Cutrer --- bundles/org.openhab.io.homekit/README.md | 2 +- .../internal/accessories/HomekitCharacteristicFactory.java | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.io.homekit/README.md b/bundles/org.openhab.io.homekit/README.md index 198e22d1afb72..097a22f4964e4 100644 --- a/bundles/org.openhab.io.homekit/README.md +++ b/bundles/org.openhab.io.homekit/README.md @@ -550,7 +550,7 @@ Support for this is planned for the future release of openHAB HomeKit binding. | | | SulphurDioxideDensity | Number | SO2 density in micrograms/m3, max 1000 | | | | PM25Density | Number | PM2.5 micrometer particulate density in micrograms/m3, max 1000 | | | | PM10Density | Number | PM10 micrometer particulate density in micrograms/m3, max 1000 | -| | | VOCDensity | Number | VOC Density in micrograms/m3, max 1000 | +| | | VOCDensity | Number | VOC Density in micrograms/m3, default max 1000, supported configuration: minValue, maxValue. | | | | Name | String | Name of the sensor | | | | ActiveStatus | Switch, Contact | Working status | | | | FaultStatus | Switch, Contact | Fault status | diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitCharacteristicFactory.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitCharacteristicFactory.java index 662addf6d54a2..6d8698c461440 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitCharacteristicFactory.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitCharacteristicFactory.java @@ -800,6 +800,11 @@ private static PM10DensityCharacteristic createPM10DensityCharacteristic(final H private static VOCDensityCharacteristic createVOCDensityCharacteristic(final HomekitTaggedItem taggedItem, HomekitAccessoryUpdater updater) { return new VOCDensityCharacteristic( + taggedItem.getConfigurationAsDouble(HomekitTaggedItem.MIN_VALUE, + VOCDensityCharacteristic.DEFAULT_MIN_VALUE), + taggedItem.getConfigurationAsDouble(HomekitTaggedItem.MAX_VALUE, + VOCDensityCharacteristic.DEFAULT_MAX_VALUE), + 1.0, getDoubleSupplier(taggedItem, taggedItem.getConfigurationAsDouble(HomekitTaggedItem.MIN_VALUE, VOCDensityCharacteristic.DEFAULT_MIN_VALUE)), From 99e1c2f41c3bfae4750697e637d4c4beddb1d6c5 Mon Sep 17 00:00:00 2001 From: Cody Cutrer Date: Sun, 9 Oct 2022 09:56:46 -0600 Subject: [PATCH 2/2] [homekit] allow step value to be configured for VOCDensity Signed-off-by: Cody Cutrer --- bundles/org.openhab.io.homekit/README.md | 2 +- .../internal/accessories/HomekitCharacteristicFactory.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.io.homekit/README.md b/bundles/org.openhab.io.homekit/README.md index 097a22f4964e4..c41300aa75465 100644 --- a/bundles/org.openhab.io.homekit/README.md +++ b/bundles/org.openhab.io.homekit/README.md @@ -550,7 +550,7 @@ Support for this is planned for the future release of openHAB HomeKit binding. | | | SulphurDioxideDensity | Number | SO2 density in micrograms/m3, max 1000 | | | | PM25Density | Number | PM2.5 micrometer particulate density in micrograms/m3, max 1000 | | | | PM10Density | Number | PM10 micrometer particulate density in micrograms/m3, max 1000 | -| | | VOCDensity | Number | VOC Density in micrograms/m3, default max 1000, supported configuration: minValue, maxValue. | +| | | VOCDensity | Number | VOC Density in micrograms/m3, default max 1000, supported configuration: minValue, maxValue, step. | | | | Name | String | Name of the sensor | | | | ActiveStatus | Switch, Contact | Working status | | | | FaultStatus | Switch, Contact | Fault status | diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitCharacteristicFactory.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitCharacteristicFactory.java index 6d8698c461440..a22020b973271 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitCharacteristicFactory.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitCharacteristicFactory.java @@ -804,7 +804,7 @@ private static VOCDensityCharacteristic createVOCDensityCharacteristic(final Hom VOCDensityCharacteristic.DEFAULT_MIN_VALUE), taggedItem.getConfigurationAsDouble(HomekitTaggedItem.MAX_VALUE, VOCDensityCharacteristic.DEFAULT_MAX_VALUE), - 1.0, + taggedItem.getConfigurationAsDouble(HomekitTaggedItem.STEP, VOCDensityCharacteristic.DEFAULT_STEP), getDoubleSupplier(taggedItem, taggedItem.getConfigurationAsDouble(HomekitTaggedItem.MIN_VALUE, VOCDensityCharacteristic.DEFAULT_MIN_VALUE)),