Skip to content

Commit f724d0b

Browse files
committed
Remove compensated channels from PR
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
1 parent a0e32b2 commit f724d0b

6 files changed

Lines changed: 5 additions & 27 deletions

File tree

bundles/org.openhab.binding.airgradient/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,6 @@ The following additional measurement channels are added dynamically, depending o
114114
| pm50-count | Number:Dimensionless | Read | Particle count for particles >= 5.0 microns per deciliter air |
115115
| pm10-count | Number:Dimensionless | Read | Particle count for particles >= 10 microns per deciliter air |
116116
| pm02-compensated | Number:Density | Read | PM2.5 concentration with correction applied |
117-
| atmp-compensated | Number:Temperature | Read | Ambient temperature with compensation |
118-
| rhum-compensated | Number:Dimensionless | Read | Relative humidity with compensation |
119117
| tvoc-index | Number:Dimensionless | Read | TVOC index value |
120118
| tvoc-raw | Number:Dimensionless | Read | Raw TVOC value |
121119
| nox-index | Number:Dimensionless | Read | NOx index value |

bundles/org.openhab.binding.airgradient/src/main/java/org/openhab/binding/airgradient/internal/AirGradientBindingConstants.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ public class AirGradientBindingConstants {
6868
public static final String CHANNEL_PM50_COUNT = "pm50-count";
6969
public static final String CHANNEL_PM10_COUNT = "pm10-count";
7070
public static final String CHANNEL_PM02_COMPENSATED = "pm02-compensated";
71-
public static final String CHANNEL_ATMP_COMPENSATED = "atmp-compensated";
72-
public static final String CHANNEL_RHUM_COMPENSATED = "rhum-compensated";
7371
public static final String CHANNEL_TVOC_INDEX = "tvoc-index";
7472
public static final String CHANNEL_TVOC_RAW = "tvoc-raw";
7573
public static final String CHANNEL_NOX_INDEX = "nox-index";

bundles/org.openhab.binding.airgradient/src/main/java/org/openhab/binding/airgradient/internal/handler/DynamicChannelHelper.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import org.openhab.binding.airgradient.internal.model.Measure;
2828
import org.openhab.core.thing.Channel;
2929
import org.openhab.core.thing.ChannelUID;
30-
import org.openhab.core.thing.DefaultSystemChannelTypeProvider;
3130
import org.openhab.core.thing.Thing;
3231
import org.openhab.core.thing.binding.builder.ChannelBuilder;
3332
import org.openhab.core.thing.binding.builder.ThingBuilder;
@@ -45,7 +44,6 @@
4544
public class DynamicChannelHelper {
4645
private static final String NUMBER_DIMENSIONLESS = NUMBER + ":Dimensionless";
4746
private static final String NUMBER_DENSITY = NUMBER + ":Density";
48-
private static final String NUMBER_TEMPERATURE = NUMBER + ":Temperature";
4947

5048
private record DynamicChannel<T> (String id, ChannelTypeUID channelTypeUID, String itemType,
5149
Predicate<T> isSupported) {
@@ -98,12 +96,6 @@ private DynamicChannel(String id, String typeId, String itemType, Predicate<T> i
9896
(measure) -> measure.pm10Count != null),
9997
new DynamicChannel<>(CHANNEL_PM02_COMPENSATED, "pm2", NUMBER_DENSITY,
10098
(measure) -> measure.pm02Compensated != null),
101-
new DynamicChannel<>(CHANNEL_ATMP_COMPENSATED,
102-
DefaultSystemChannelTypeProvider.SYSTEM_CHANNEL_TYPE_UID_OUTDOOR_TEMPERATURE, NUMBER_TEMPERATURE,
103-
(measure) -> measure.atmpCompensated != null),
104-
new DynamicChannel<>(CHANNEL_RHUM_COMPENSATED,
105-
DefaultSystemChannelTypeProvider.SYSTEM_CHANNEL_TYPE_UID_ATMOSPHERIC_HUMIDITY, NUMBER_DIMENSIONLESS,
106-
(measure) -> measure.rhumCompensated != null),
10799
new DynamicChannel<>(CHANNEL_TVOC_INDEX, "tvoc", NUMBER_DIMENSIONLESS,
108100
(measure) -> measure.tvocIndex != null),
109101
new DynamicChannel<>(CHANNEL_TVOC_RAW, "tvoc", NUMBER_DIMENSIONLESS, (measure) -> measure.tvocRaw != null),

bundles/org.openhab.binding.airgradient/src/main/java/org/openhab/binding/airgradient/internal/handler/MeasureHelper.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,12 @@ public static Map<String, State> createStates(Measure measure) {
6767
Map<String, State> states = new HashMap<>(11);
6868

6969
states.put(CHANNEL_ATMP, toQuantityType(measure.getTemperature(), SIUnits.CELSIUS));
70-
states.put(CHANNEL_ATMP_COMPENSATED, toQuantityType(measure.atmpCompensated, SIUnits.CELSIUS));
7170
states.put(CHANNEL_PM_003_COUNT, toQuantityType(measure.pm003Count, Units.ONE));
7271
states.put(CHANNEL_PM_01, toQuantityType(measure.pm01, Units.MICROGRAM_PER_CUBICMETRE));
7372
states.put(CHANNEL_PM_02, toQuantityType(measure.pm02, Units.MICROGRAM_PER_CUBICMETRE));
7473
states.put(CHANNEL_PM02_COMPENSATED, toQuantityType(measure.pm02Compensated, Units.MICROGRAM_PER_CUBICMETRE));
7574
states.put(CHANNEL_PM_10, toQuantityType(measure.pm10, Units.MICROGRAM_PER_CUBICMETRE));
7675
states.put(CHANNEL_RHUM, toQuantityType(measure.getHumidity(), Units.PERCENT));
77-
states.put(CHANNEL_RHUM_COMPENSATED, toQuantityType(measure.rhumCompensated, Units.PERCENT));
7876
states.put(CHANNEL_UPLOADS_SINCE_BOOT, toQuantityType(measure.getBootCount(), Units.ONE));
7977

8078
Double rco2 = measure.rco2;

bundles/org.openhab.binding.airgradient/src/main/resources/OH-INF/thing/thing-types.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@
7676
<channel id="pm50-count" typeId="particle-count"/>
7777
<channel id="pm10-count" typeId="particle-count"/>
7878
<channel id="pm02-compensated" typeId="pm2"/>
79-
<channel id="atmp-compensated" typeId="system.outdoor-temperature"/>
80-
<channel id="rhum-compensated" typeId="system.atmospheric-humidity"/>
8179
<channel id="tvoc-index" typeId="tvoc"/>
8280
<channel id="tvoc-raw" typeId="tvoc"/>
8381
<channel id="nox-index" typeId="nox"/>

bundles/org.openhab.binding.airgradient/src/test/java/org/openhab/binding/airgradient/internal/handler/DynamicChannelHelperTest.java

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ public void testAddsOnlySupportedMeasurementChannels() {
6868
measure.pm50Count = 29d;
6969
measure.pm10Count = 31d;
7070
measure.pm02Compensated = 11d;
71-
measure.atmpCompensated = 20d;
72-
measure.rhumCompensated = 50d;
7371
measure.tvocIndex = 1d;
7472
measure.tvocRaw = 2d;
7573
measure.noxIndex = 2d;
@@ -80,12 +78,12 @@ public void testAddsOnlySupportedMeasurementChannels() {
8078

8179
assertThat(Objects.requireNonNull(returnedBuilder), is(builder));
8280
ArgumentCaptor<Channel> captor = ArgumentCaptor.forClass(Channel.class);
83-
verify(builder, Mockito.times(15)).withChannel(captor.capture());
81+
verify(builder, Mockito.times(13)).withChannel(captor.capture());
8482
List<String> channelIds = captor.getAllValues().stream().map((channel) -> channel.getUID().getId()).toList();
8583
assertThat(channelIds,
8684
containsInAnyOrder("pm01-standard", "pm02-standard", "pm10-standard", "pm005-count", "pm01-count",
87-
"pm02-count", "pm50-count", "pm10-count", "pm02-compensated", "atmp-compensated",
88-
"rhum-compensated", "tvoc-index", "tvoc-raw", "nox-index", "nox-raw"));
85+
"pm02-count", "pm50-count", "pm10-count", "pm02-compensated", "tvoc-index", "tvoc-raw",
86+
"nox-index", "nox-raw"));
8987

9088
Map<String, String> channelTypes = captor.getAllValues().stream()
9189
.collect(Collectors.toMap((channel) -> channel.getUID().getId(),
@@ -97,8 +95,6 @@ public void testAddsOnlySupportedMeasurementChannels() {
9795
Map.entry("pm02-count", "airgradient:particle-count"),
9896
Map.entry("pm50-count", "airgradient:particle-count"),
9997
Map.entry("pm10-count", "airgradient:particle-count"), Map.entry("pm02-compensated", "airgradient:pm2"),
100-
Map.entry("atmp-compensated", "system:outdoor-temperature"),
101-
Map.entry("rhum-compensated", "system:atmospheric-humidity"),
10298
Map.entry("tvoc-index", "airgradient:tvoc"), Map.entry("tvoc-raw", "airgradient:tvoc"),
10399
Map.entry("nox-index", "airgradient:nox"), Map.entry("nox-raw", "airgradient:nox"))));
104100

@@ -110,10 +106,8 @@ public void testAddsOnlySupportedMeasurementChannels() {
110106
Map.entry("pm005-count", "Number:Dimensionless"), Map.entry("pm01-count", "Number:Dimensionless"),
111107
Map.entry("pm02-count", "Number:Dimensionless"), Map.entry("pm50-count", "Number:Dimensionless"),
112108
Map.entry("pm10-count", "Number:Dimensionless"), Map.entry("pm02-compensated", "Number:Density"),
113-
Map.entry("atmp-compensated", "Number:Temperature"),
114-
Map.entry("rhum-compensated", "Number:Dimensionless"), Map.entry("tvoc-index", "Number:Dimensionless"),
115-
Map.entry("tvoc-raw", "Number:Dimensionless"), Map.entry("nox-index", "Number:Dimensionless"),
116-
Map.entry("nox-raw", "Number:Dimensionless"))));
109+
Map.entry("tvoc-index", "Number:Dimensionless"), Map.entry("tvoc-raw", "Number:Dimensionless"),
110+
Map.entry("nox-index", "Number:Dimensionless"), Map.entry("nox-raw", "Number:Dimensionless"))));
117111
}
118112

119113
@Test

0 commit comments

Comments
 (0)