import org.openhab.binding.freeboxos.internal.api.rest.SystemManager.Config;
import org.openhab.binding.freeboxos.internal.api.rest.UPnPAVManager;
import org.openhab.binding.freeboxos.internal.api.rest.WifiManager;
-import org.openhab.core.library.CoreItemFactory;
import org.openhab.core.library.types.QuantityType;
import org.openhab.core.library.unit.SIUnits;
import org.openhab.core.library.unit.Units;
config.sensors().forEach(sensor -> {
ChannelUID sensorId = new ChannelUID(thing.getUID(), GROUP_SENSORS, sensor.id());
if (getThing().getChannel(sensorId) == null) {
- channels.add(ChannelBuilder.create(sensorId).withLabel(sensor.name())
- .withAcceptedItemType("Number:Temperature")
- .withType(new ChannelTypeUID(BINDING_ID + ":temperature")).build());
+ String label = sensor.name();
+ // For revolution, API returns only "Disque dur" so we patch it to have naming consistency with other
+ // temperature sensors
+ if ("Disque dur".equals(label)) {
+ label = "Température " + label;
+ }
+ channels.add(ChannelBuilder.create(sensorId).withLabel(label).withAcceptedItemType("Number:Temperature")
+ .withType(new ChannelTypeUID(BINDING_ID, "temperature")).build());
}
});
config.fans().forEach(sensor -> {
ChannelUID sensorId = new ChannelUID(thing.getUID(), GROUP_FANS, sensor.id());
if (getThing().getChannel(sensorId) == null) {
channels.add(ChannelBuilder.create(sensorId).withLabel(sensor.name())
- .withAcceptedItemType(CoreItemFactory.NUMBER)
- .withType(new ChannelTypeUID(BINDING_ID + ":fanspeed")).build());
+ .withAcceptedItemType("Number:Frequency").withType(new ChannelTypeUID(BINDING_ID, "fanspeed"))
+ .build());
}
});
if (nbInit != channels.size()) {
</channel-type>
<channel-type id="fanspeed" advanced="true">
- <item-type>Number:Frequency</item-type>
+ <item-type unitHint="rpm">Number:Frequency</item-type>
<label>Fan Speed</label>
<description>Actual measured rotation speed of the fan</description>
<category>Fan</category>
- <state readOnly="true" pattern="%d %unit%"/>
+ <state readOnly="true" pattern="%d rpm"/>
</channel-type>
<channel-type id="samba-file-status" advanced="true">