use of org.eclipse.smarthome.core.thing.profiles.TriggerProfile in project smarthome by eclipse.
the class CommunicationManager method receiveTrigger.
private void receiveTrigger(ChannelTriggeredEvent channelTriggeredEvent) {
final ChannelUID channelUID = channelTriggeredEvent.getChannel();
final String event = channelTriggeredEvent.getEvent();
final Thing thing = getThing(channelUID.getThingUID());
handleCallFromHandler(channelUID, thing, profile -> {
if (profile instanceof TriggerProfile) {
((TriggerProfile) profile).onTriggerFromHandler(event);
}
});
}
use of org.eclipse.smarthome.core.thing.profiles.TriggerProfile in project smarthome by eclipse.
the class RawButtonToggleSwitchProfileTest method testSwitchItem.
@Test
public void testSwitchItem() {
TriggerProfile profile = new RawButtonToggleSwitchProfile(mockCallback);
verifyAction(profile, UnDefType.NULL, OnOffType.ON);
verifyAction(profile, OnOffType.ON, OnOffType.OFF);
verifyAction(profile, OnOffType.OFF, OnOffType.ON);
}
use of org.eclipse.smarthome.core.thing.profiles.TriggerProfile in project smarthome by eclipse.
the class RawButtonToggleSwitchProfileTest method testColorItem.
@Test
public void testColorItem() {
TriggerProfile profile = new RawButtonToggleSwitchProfile(mockCallback);
verifyAction(profile, UnDefType.NULL, OnOffType.ON);
verifyAction(profile, HSBType.WHITE, OnOffType.OFF);
verifyAction(profile, HSBType.BLACK, OnOffType.ON);
}
Aggregations