use of org.openhab.binding.omatic.internal.OMaticChannel in project omatic by seaside1.
the class OMaticMachineThingHandler method handleCommand.
@Override
public void handleCommand(ChannelUID channelUID, Command command) {
logDebug("Handling command = {} for channel = {}", command.getClass(), channelUID);
String channelId = channelUID.getIdWithoutGroup();
OMaticChannel channel = OMaticChannel.fromString(channelId);
if (command instanceof RefreshType) {
refreshChannel(channel, channelId);
return;
}
if (command instanceof OnOffType) {
updateOnOffChannel(channel, channelId, (OnOffType) command);
return;
}
}
use of org.openhab.binding.omatic.internal.OMaticChannel in project omatic by seaside1.
the class OMaticMachineThingHandler method refreshChannels.
private void refreshChannels() {
if (getThing().getStatus() == ONLINE) {
for (Channel channel : getThing().getChannels()) {
ChannelUID channelUID = channel.getUID();
String channelId = channelUID.getIdWithoutGroup();
OMaticChannel omaticChannel = OMaticChannel.fromString(channelId);
refreshChannel(omaticChannel, channelId);
}
}
}
Aggregations