mirror of
https://github.com/danieldemus/openhab-addons
synced 2026-07-29 12:34:21 +02:00
[matter] Remove pattern from state options (#19644)
Removes the "withPattern" option from dynamic state builders where it was not intended to be used for numeric values that map to String labels. Signed-off-by: Dan Cunningham <dan@digitaldan.com>
This commit is contained in:
+2
-2
@@ -60,8 +60,8 @@ public class AirQualityConverter extends GenericConverter<AirQualityCluster> {
|
||||
options.add(new StateOption(e.getValue().toString(), e.getLabel()));
|
||||
}
|
||||
|
||||
StateDescription stateDescription = StateDescriptionFragmentBuilder.create().withPattern("%d")
|
||||
.withOptions(options).build().toStateDescription();
|
||||
StateDescription stateDescription = StateDescriptionFragmentBuilder.create().withOptions(options).build()
|
||||
.toStateDescription();
|
||||
|
||||
return Collections.singletonMap(channel, stateDescription);
|
||||
}
|
||||
|
||||
+2
-2
@@ -114,8 +114,8 @@ public class FanControlConverter extends GenericConverter<FanControlCluster> {
|
||||
break;
|
||||
}
|
||||
|
||||
StateDescription stateDescriptionMode = StateDescriptionFragmentBuilder.create().withPattern("%d")
|
||||
.withOptions(modeOptions).build().toStateDescription();
|
||||
StateDescription stateDescriptionMode = StateDescriptionFragmentBuilder.create().withOptions(modeOptions)
|
||||
.build().toStateDescription();
|
||||
|
||||
channels.put(modeChannel, stateDescriptionMode);
|
||||
}
|
||||
|
||||
+2
-2
@@ -59,8 +59,8 @@ public class ModeSelectConverter extends GenericConverter<ModeSelectCluster> {
|
||||
initializingCluster.supportedModes
|
||||
.forEach(mode -> modeOptions.add(new StateOption(mode.mode.toString(), mode.label)));
|
||||
|
||||
StateDescription stateDescriptionMode = StateDescriptionFragmentBuilder.create().withPattern("%d")
|
||||
.withOptions(modeOptions).build().toStateDescription();
|
||||
StateDescription stateDescriptionMode = StateDescriptionFragmentBuilder.create().withOptions(modeOptions)
|
||||
.build().toStateDescription();
|
||||
|
||||
return Collections.singletonMap(channel, stateDescriptionMode);
|
||||
}
|
||||
|
||||
+2
-2
@@ -73,8 +73,8 @@ public class PowerSourceConverter extends GenericConverter<PowerSourceCluster> {
|
||||
for (BatChargeLevelEnum mode : BatChargeLevelEnum.values()) {
|
||||
options.add(new StateOption(mode.getValue().toString(), mode.getLabel()));
|
||||
}
|
||||
StateDescription stateDescription = StateDescriptionFragmentBuilder.create().withPattern("%d")
|
||||
.withOptions(options).build().toStateDescription();
|
||||
StateDescription stateDescription = StateDescriptionFragmentBuilder.create().withOptions(options)
|
||||
.build().toStateDescription();
|
||||
channels.put(channel, stateDescription);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -90,8 +90,8 @@ public class SwitchConverter extends GenericConverter<SwitchCluster> {
|
||||
options.add(new StateOption(String.valueOf(i), "Position " + i));
|
||||
}
|
||||
|
||||
StateDescription stateDescriptionMode = StateDescriptionFragmentBuilder.create().withPattern("%d")
|
||||
.withOptions(options).build().toStateDescription();
|
||||
StateDescription stateDescriptionMode = StateDescriptionFragmentBuilder.create().withOptions(options).build()
|
||||
.toStateDescription();
|
||||
|
||||
map.put(channel, stateDescriptionMode);
|
||||
|
||||
|
||||
+2
-2
@@ -87,8 +87,8 @@ public class ThermostatConverter extends GenericConverter<ThermostatCluster> {
|
||||
modeOptions.add(new StateOption(ThermostatCluster.SystemModeEnum.SLEEP.getValue().toString(),
|
||||
ThermostatCluster.SystemModeEnum.SLEEP.getLabel()));
|
||||
|
||||
StateDescription stateDescriptionMode = StateDescriptionFragmentBuilder.create().withPattern("%d")
|
||||
.withOptions(modeOptions).build().toStateDescription();
|
||||
StateDescription stateDescriptionMode = StateDescriptionFragmentBuilder.create().withOptions(modeOptions)
|
||||
.build().toStateDescription();
|
||||
channels.put(channel, stateDescriptionMode);
|
||||
|
||||
if (!initializingCluster.featureMap.localTemperatureNotExposed) {
|
||||
|
||||
Reference in New Issue
Block a user