diff --git a/bundles/org.openhab.binding.homeconnect/README.md b/bundles/org.openhab.binding.homeconnect/README.md index 530c16c6fbc0..6612b0545426 100644 --- a/bundles/org.openhab.binding.homeconnect/README.md +++ b/bundles/org.openhab.binding.homeconnect/README.md @@ -64,7 +64,9 @@ After the bridge has been added and authorized, devices are discovered automatic | laundry_care_washer_less_ironing | Switch | true | This status indicates whether less ironing is activated for a washer program of the home appliance. | washer, washerdryer | | laundry_care_washer_pre_wash | Switch | true | This status indicates whether the pre-wash is activated for a washer program of the home appliance. | washer, washerdryer | | laundry_care_washer_rinse_plus | String | true | This status defines the number of additional rinses of a washer program of the home appliance. | washer, washerdryer | +| laundry_care_washer_rinse_hold | Switch | true | This status indicates whether the spin function is deactivated for a washer program of the home appliance (washing will remain in the water after the last rinse cycle). | washer, washerdryer | | laundry_care_washer_soak | Switch | true | This status indicates whether the soaking is activated for a washer program of the home appliance. | washer, washerdryer | +| laundry_care_washer_load_recommendation | Number:Mass | true | This channel indicates the maximum laundry load recommended for a program of the home appliance. | washer, washerdryer | | program_energy | Number:Dimensionless | true | This channel provides the estimated energy required in percentage for a program of the home appliance. | washer, washerdryer | | program_water | Number:Dimensionless | true | This channel provides the estimated water required in percentage for a program of the home appliance. | washer, washerdryer | | dryer_drying_target | String | false | This status defines the desired dryness of a program of the home appliance. | dryer, washerdryer | diff --git a/bundles/org.openhab.binding.homeconnect/src/main/java/org/openhab/binding/homeconnect/internal/HomeConnectBindingConstants.java b/bundles/org.openhab.binding.homeconnect/src/main/java/org/openhab/binding/homeconnect/internal/HomeConnectBindingConstants.java index f07647d256cc..6718f41ac083 100644 --- a/bundles/org.openhab.binding.homeconnect/src/main/java/org/openhab/binding/homeconnect/internal/HomeConnectBindingConstants.java +++ b/bundles/org.openhab.binding.homeconnect/src/main/java/org/openhab/binding/homeconnect/internal/HomeConnectBindingConstants.java @@ -128,7 +128,9 @@ public class HomeConnectBindingConstants { public static final String CHANNEL_WASHER_LESS_IRONING = "laundry_care_washer_less_ironing"; public static final String CHANNEL_WASHER_PRE_WASH = "laundry_care_washer_pre_wash"; public static final String CHANNEL_WASHER_RINSE_PLUS = "laundry_care_washer_rinse_plus"; + public static final String CHANNEL_WASHER_RINSE_HOLD = "laundry_care_washer_rinse_hold"; public static final String CHANNEL_WASHER_SOAK = "laundry_care_washer_soak"; + public static final String CHANNEL_WASHER_LOAD_RECOMMENDATION = "laundry_care_washer_load_recommendation"; public static final String CHANNEL_PROGRAM_ENERGY = "program_energy"; public static final String CHANNEL_PROGRAM_WATER = "program_water"; public static final String CHANNEL_REFRIGERATOR_SETPOINT_TEMPERATURE = "setpoint_temperature_refrigerator"; @@ -188,7 +190,9 @@ public class HomeConnectBindingConstants { public static final String OPTION_WASHER_LESS_IRONING = "LaundryCare.Washer.Option.LessIroning"; public static final String OPTION_WASHER_PRE_WASH = "LaundryCare.Washer.Option.Prewash"; public static final String OPTION_WASHER_RINSE_PLUS = "LaundryCare.Washer.Option.RinsePlus"; + public static final String OPTION_WASHER_RINSE_HOLD = "LaundryCare.Washer.Option.RinseHold"; public static final String OPTION_WASHER_SOAK = "LaundryCare.Washer.Option.Soak"; + public static final String OPTION_WASHER_LOAD_RECOMMENDATION = "LaundryCare.Common.Option.LoadRecommendation"; public static final String OPTION_WASHER_ENERGY_FORECAST = "BSH.Common.Option.EnergyForecast"; public static final String OPTION_WASHER_WATER_FORECAST = "BSH.Common.Option.WaterForecast"; public static final String OPTION_DRYER_DRYING_TARGET = "LaundryCare.Dryer.Option.DryingTarget"; diff --git a/bundles/org.openhab.binding.homeconnect/src/main/java/org/openhab/binding/homeconnect/internal/handler/AbstractHomeConnectThingHandler.java b/bundles/org.openhab.binding.homeconnect/src/main/java/org/openhab/binding/homeconnect/internal/handler/AbstractHomeConnectThingHandler.java index dd2957fde065..183c4039b493 100644 --- a/bundles/org.openhab.binding.homeconnect/src/main/java/org/openhab/binding/homeconnect/internal/handler/AbstractHomeConnectThingHandler.java +++ b/bundles/org.openhab.binding.homeconnect/src/main/java/org/openhab/binding/homeconnect/internal/handler/AbstractHomeConnectThingHandler.java @@ -16,7 +16,7 @@ import static org.openhab.binding.homeconnect.internal.HomeConnectBindingConstants.*; import static org.openhab.binding.homeconnect.internal.client.model.EventType.*; import static org.openhab.core.library.unit.ImperialUnits.FAHRENHEIT; -import static org.openhab.core.library.unit.SIUnits.CELSIUS; +import static org.openhab.core.library.unit.SIUnits.*; import static org.openhab.core.library.unit.Units.*; import static org.openhab.core.thing.ThingStatus.*; @@ -35,6 +35,7 @@ import javax.measure.UnconvertibleException; import javax.measure.Unit; +import javax.measure.quantity.Mass; import javax.measure.quantity.Temperature; import org.eclipse.jdt.annotation.NonNullByDefault; @@ -675,6 +676,22 @@ protected Unit mapTemperature(@Nullable String unit) { } } + /** + * Map unit string (returned by home connect api) to Unit + * + * @param unit String eg. "gram" + * @return Unit + */ + protected Unit mapMass(@Nullable String unit) { + if ("gram".equalsIgnoreCase(unit)) { + return GRAM; + } else if ("kilogram".equalsIgnoreCase(unit)) { + return KILOGRAM; + } else { + return GRAM; + } + } + /** * Map hex representation of color to HSB type. * @@ -1405,7 +1422,8 @@ protected void processProgramOptions(List