use of org.openhab.binding.benqprojector.BenqProjectorBindingProvider in project openhab1-addons by openhab.
the class BenqProjectorBinding method internalReceiveCommand.
/**
* @{inheritDoc
*/
@Override
protected void internalReceiveCommand(String itemName, Command command) {
for (BenqProjectorBindingProvider binding : super.providers) {
if (binding.providesBindingFor(itemName)) {
logger.debug("Process command " + command + " for " + itemName);
BenqProjectorBindingConfig cfg = binding.getConfigForItemName(itemName);
String resp = sendCommandToProjector(cfg, command);
State s = cfg.mode.parseResponse(resp);
if (!(s instanceof UnDefType)) {
eventPublisher.postUpdate(itemName, s);
logger.debug(itemName + " status is " + s);
} else {
logger.debug(itemName + " not updated as result was undefined");
}
}
}
}
use of org.openhab.binding.benqprojector.BenqProjectorBindingProvider in project openhab1-addons by openhab.
the class BenqProjectorBinding method execute.
/**
* @{inheritDoc
*/
@Override
protected void execute() {
for (BenqProjectorBindingProvider binding : super.providers) {
for (String itemName : binding.getItemNames()) {
logger.debug("Polling projector status for " + itemName);
BenqProjectorBindingConfig cfg = binding.getConfigForItemName(itemName);
State s = queryProjector(cfg);
if (!(s instanceof UnDefType)) {
eventPublisher.postUpdate(itemName, s);
logger.debug(itemName + " status is " + s);
} else {
logger.debug(itemName + " not updated as result was undefined");
}
}
}
}
Aggregations