use of org.eclipse.smarthome.core.thing.profiles.StateProfile in project smarthome by eclipse.
the class CommunicationManager method receiveCommand.
private void receiveCommand(ItemCommandEvent commandEvent) {
final String itemName = commandEvent.getItemName();
final Command command = commandEvent.getItemCommand();
handleEvent(itemName, command, commandEvent.getSource(), s -> acceptedCommandTypeMap.get(s), (profile, thing, convertedCommand) -> {
if (profile instanceof StateProfile) {
//
safeCaller.create(((StateProfile) profile), StateProfile.class).withAsync().withIdentifier(//
thing).withTimeout(//
THINGHANDLER_EVENT_TIMEOUT).build().onCommandFromItem(convertedCommand);
}
});
}
use of org.eclipse.smarthome.core.thing.profiles.StateProfile in project smarthome by eclipse.
the class CommunicationManager method postCommand.
public void postCommand(ChannelUID channelUID, Command command) {
final Thing thing = getThing(channelUID.getThingUID());
handleCallFromHandler(channelUID, thing, profile -> {
if (profile instanceof StateProfile) {
((StateProfile) profile).onCommandFromHandler(command);
}
});
}
use of org.eclipse.smarthome.core.thing.profiles.StateProfile in project smarthome by eclipse.
the class CommunicationManager method stateUpdated.
public void stateUpdated(ChannelUID channelUID, State state) {
final Thing thing = getThing(channelUID.getThingUID());
handleCallFromHandler(channelUID, thing, profile -> {
if (profile instanceof StateProfile) {
((StateProfile) profile).onStateUpdateFromHandler(state);
}
});
}
Aggregations