Skip to content

Commit

Permalink
openhab#14 Use SmartHomeUnits instead of AbstractUnit in BoschTwingua…
Browse files Browse the repository at this point in the history
…rdHandler

Signed-off-by: Christian Oeing <[email protected]>
Signed-off-by: Gerd Zanker <[email protected]>
  • Loading branch information
coeing authored and GerdZanker committed Jan 7, 2021
1 parent bf2283a commit 6838c25
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.openhab.core.library.types.QuantityType;
import org.openhab.core.library.types.StringType;
import org.openhab.core.library.unit.SIUnits;
import org.openhab.core.library.unit.SmartHomeUnits;
import org.openhab.core.thing.Bridge;
import org.openhab.core.thing.ChannelUID;
import org.openhab.core.thing.Thing;
Expand All @@ -34,8 +35,6 @@
import com.google.gson.JsonElement;
import com.google.gson.JsonSyntaxException;

import tec.uom.se.AbstractUnit;

/**
* The {@link BoschSHCHandler} is responsible for handling commands for the TwinGuard handler.
*
Expand Down Expand Up @@ -69,9 +68,9 @@ public void handleCommand(ChannelUID channelUID, Command command) {
void updateAirQualityState(AirQualityLevelState state) {
updateState(CHANNEL_TEMPERATURE, new QuantityType<Temperature>(state.temperature, SIUnits.CELSIUS));
updateState(CHANNEL_TEMPERATURE_RATING, new StringType(state.temperatureRating));
updateState(CHANNEL_HUMIDITY, new QuantityType<Dimensionless>(state.humidity, AbstractUnit.ONE));
updateState(CHANNEL_HUMIDITY, new QuantityType<Dimensionless>(state.humidity, SmartHomeUnits.ONE));
updateState(CHANNEL_HUMIDITY_RATING, new StringType(state.humidityRating));
updateState(CHANNEL_PURITY, new QuantityType<Dimensionless>(state.purity, AbstractUnit.ONE));
updateState(CHANNEL_PURITY, new QuantityType<Dimensionless>(state.purity, SmartHomeUnits.ONE));
updateState(CHANNEL_AIR_DESCRIPTION, new StringType(state.description));
updateState(CHANNEL_PURITY_RATING, new StringType(state.purityRating));
updateState(CHANNEL_COMBINED_RATING, new StringType(state.combinedRating));
Expand Down

0 comments on commit 6838c25

Please sign in to comment.