Skip to content

Commit

Permalink
Fix dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: James Melville <jamesmelville@gmail.com>
  • Loading branch information
jamesmelville committed May 22, 2021
1 parent 120ad67 commit f0dbfd8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.openhab.binding.mqtt.generic.values.TextValue;
import org.openhab.binding.mqtt.generic.values.Value;
import org.openhab.binding.mqtt.homeassistant.internal.listener.ExpireUpdateStateListener;
import org.openhab.core.thing.ChannelUID;

/**
* A MQTT sensor, following the https://www.home-assistant.io/components/sensor.mqtt/ specification.
Expand Down Expand Up @@ -61,7 +62,8 @@ public ComponentSensor(CFactory.ComponentConfiguration componentConfiguration) {
String uom = channelConfiguration.unit_of_measurement;

if (uom != null && !uom.isBlank()) {
value = new NumberValue(null, null, null, uom);
value = new NumberValue(new ChannelUID(componentConfiguration.getThingUID(), sensorChannelID), null, null,
null, uom);
} else {
value = new TextValue();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public void createChannelFromAttribute() {
if (attributes.unit.contains("%") && attributes.settable) {
value = new PercentageValue(min, max, step, null, null);
} else {
value = new NumberValue(min, max, step, attributes.unit);
value = new NumberValue(channelUID, min, max, step, attributes.unit);
}
break;
case string_:
Expand Down

0 comments on commit f0dbfd8

Please sign in to comment.