• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RefreshType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.smarthome.core.types.RefreshType的典型用法代码示例。如果您正苦于以下问题:Java RefreshType类的具体用法?Java RefreshType怎么用?Java RefreshType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RefreshType类属于org.eclipse.smarthome.core.types包,在下文中一共展示了RefreshType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: handleCommand

import org.eclipse.smarthome.core.types.RefreshType; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void handleCommand(ChannelUID channelUID, Command command) {
	MaxCubeBridgeHandler maxCubeBridge = getMaxCubeBridgeHandler();
	if (maxCubeBridge == null) {
		logger.warn("MAX! Cube LAN gateway bridge handler not found. Cannot handle command without bridge.");
		return;
	}
	if (command instanceof RefreshType) {
		forceRefresh = true;
		maxCubeBridge.handleCommand(channelUID, command);
		return;
	}
	if (maxDeviceSerial == null) {
		logger.warn("Serial number missing. Can't send command to device '{}'", getThing());
		return;
	}

	if (channelUID.getId().equals(CHANNEL_SETTEMP) || channelUID.getId().equals(CHANNEL_MODE)) {
		SendCommand sendCommand = new SendCommand(maxDeviceSerial, channelUID, command);
		maxCubeBridge.queueCommand(sendCommand);
	} else {
		logger.warn("Setting of channel {} not possible. Read-only", channelUID);
	}
}
 
开发者ID:Neulinet,项目名称:Zoo,代码行数:28,代码来源:MaxDevicesHandler.java


示例2: handleCommand

import org.eclipse.smarthome.core.types.RefreshType; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void handleCommand(ChannelUID channelUID, Command command) {

	Ip2WireBridgeHandler bridgeHandler = getBridgeHandler();
	if (bridgeHandler == null) {
		logger.warn("LAN gateway bridge handler not found. Cannot handle command without bridge.");
		return;
	}
	if (command instanceof RefreshType) {
		forceRefresh = true;
		bridgeHandler.handleCommand(channelUID, command);
		return;
	}
	if (deviceWhereAddress == null) {
		logger.warn("Where Address missing. Can't send command to device '{}'", getThing());
		return;
	}
	
	if (channelUID.getId().equals(CHANNEL_SWITCH_ON_OFF_CAMERA) || channelUID.getId().equals(CHANNEL_OPEN_LOCK)) {
		OwnRequest sendCommand = new OwnRequest(deviceWhereAddress, channelUID, command);
		bridgeHandler.queueCommand(sendCommand);
	} else {
		logger.warn("Setting of channel {} not possible. Read-only", channelUID);
	}
}
 
开发者ID:Neulinet,项目名称:Zoo,代码行数:29,代码来源:OpenWebNetVdesHandler.java


示例3: handleCommand

import org.eclipse.smarthome.core.types.RefreshType; //导入依赖的package包/类
@Override
public void handleCommand(ChannelUID channelUID, Command command) {
       if (command instanceof RefreshType) {
           switch (channelUID.getId()) {
           case CHANNEL_ONLINE:
           	try {
				State state = networkService.updateDeviceState() ? OnOffType.ON : OnOffType.OFF;
				updateState(CHANNEL_ONLINE, state);					
			} catch( InvalidConfigurationException invalidConfigurationException) {
				getThing().setStatus(ThingStatus.OFFLINE);
			}
           	break;
           default:
               logger.debug("Command received for an unknown channel: {}", channelUID.getId());
               break;
           }
       } else {
           logger.debug("Command {} is not supported for channel: {}", command, channelUID.getId());
       }	
}
 
开发者ID:Neulinet,项目名称:Zoo,代码行数:21,代码来源:NetworkHandler.java


示例4: handleCommand

import org.eclipse.smarthome.core.types.RefreshType; //导入依赖的package包/类
@Override
public void handleCommand(ChannelUID channelUID, Command command) {
    logger.debug("Handle command '{}' for {}", command, channelUID);

    try {
        if (command == RefreshType.REFRESH) {
            update();
        } else if (channelUID.getId().equals(WiFiLEDBindingConstants.CHANNEL_POWER)) {
            handleColorCommand(command);
        } else if (channelUID.getId().equals(WiFiLEDBindingConstants.CHANNEL_COLOR)) {
            handleColorCommand(command);
        } else if (channelUID.getId().equals(WiFiLEDBindingConstants.CHANNEL_WHITE)) {
            handleWhiteCommand(command);
        } else if (channelUID.getId().equals(WiFiLEDBindingConstants.CHANNEL_WHITE2)) {
            handleWhite2Command(command);
        } else if (channelUID.getId().equals(WiFiLEDBindingConstants.CHANNEL_PROGRAM)
                && (command instanceof StringType)) {
            driver.setProgram((StringType) command);
        } else if (channelUID.getId().equals(WiFiLEDBindingConstants.CHANNEL_PROGRAM_SPEED)) {
            handleProgramSpeedCommand(command);
        }
    } catch (IOException e) {
        updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.COMMUNICATION_ERROR, e.getMessage());
    }
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:26,代码来源:WiFiLEDHandler.java


示例5: handleCommand

import org.eclipse.smarthome.core.types.RefreshType; //导入依赖的package包/类
@Override
public void handleCommand(@NonNull ChannelUID channelUID, Command command) {
    logger.trace("Command '{}' received for channel '{}'", command, channelUID);

    String channelId = channelUID.getId();
    if (channelId.equals(FIND_MY_PHONE)) {
        if (command == OnOffType.ON) {
            try {
                bridge.findMyDevice(deviceId);
            } catch (IOException e) {
                logger.warn("Unable to execute find my device request", e);
            }
            updateState(FIND_MY_PHONE, OnOffType.OFF);
        }
    }

    if (command instanceof RefreshType) {
        bridge.refreshData();
    }
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:21,代码来源:ICloudDeviceHandler.java


示例6: handleCommand

import org.eclipse.smarthome.core.types.RefreshType; //导入依赖的package包/类
@Override
public void handleCommand(ChannelUID channelUID, Command command) {
    if ((getThing().getStatus() == ThingStatus.OFFLINE)
            && ((getThing().getStatusInfo().getStatusDetail() == ThingStatusDetail.BRIDGE_OFFLINE)
                    || (getThing().getStatusInfo().getStatusDetail() == ThingStatusDetail.CONFIGURATION_ERROR))) {
        return;
    }
    try {
        if (command == null || command instanceof RefreshType) {
            return;
        } else if (command instanceof StringType && PLAYURL.equals(channelUID.getId())) {
            playMedia(command.toString());
        } else if (command instanceof OnOffType && STOP.equals(channelUID.getId())) {
            stopMedia();
        } else {
            logger.debug("Thing {}: unexpected command {} from channel {}", getThing().getUID(), command,
                    channelUID.getId());
        }
    } catch (FreeboxException e) {
        logger.debug("Thing {}: error while handling command {} from channel {}", getThing().getUID(), command,
                channelUID.getId(), e);
        updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR);
    }
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:25,代码来源:FreeboxThingHandler.java


示例7: handleCommand

import org.eclipse.smarthome.core.types.RefreshType; //导入依赖的package包/类
@Override
public void handleCommand(final ChannelUID channelUID, final Command command) {
    if (channelUID.getId().equals(WIFI_SOCKET_CHANNEL_ID)) {
        logger.debug("Silvercrest socket command received: {}", command);

        if (command == OnOffType.ON) {
            this.sendCommand(SilvercrestWifiSocketRequestType.ON);

        } else if (command == OnOffType.OFF) {
            this.sendCommand(SilvercrestWifiSocketRequestType.OFF);

        } else if (command == RefreshType.REFRESH) {
            this.sendCommand(SilvercrestWifiSocketRequestType.GPIO_STATUS);
        }
    }
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:17,代码来源:SilvercrestWifiSocketHandler.java


示例8: handleVolumeSet

import org.eclipse.smarthome.core.types.RefreshType; //导入依赖的package包/类
private void handleVolumeSet(EiscpCommand.Zone zone, final State currentValue, final Command command) {
    if (command instanceof PercentType) {
        sendCommand(EiscpCommand.getCommandForZone(zone, EiscpCommand.VOLUME_SET),
                downScaleVolume((PercentType) command));
    } else if (command.equals(IncreaseDecreaseType.INCREASE)) {
        if (currentValue instanceof PercentType) {
            if (((DecimalType) currentValue).intValue() < configuration.volumeLimit) {
                sendCommand(EiscpCommand.getCommandForZone(zone, EiscpCommand.VOLUME_UP));
            } else {
                logger.info("Volume level is limited to {}, ignore volume up command.", configuration.volumeLimit);
            }
        }
    } else if (command.equals(IncreaseDecreaseType.DECREASE)) {
        sendCommand(EiscpCommand.getCommandForZone(zone, EiscpCommand.VOLUME_DOWN));
    } else if (command.equals(OnOffType.OFF)) {
        sendCommand(EiscpCommand.getCommandForZone(zone, EiscpCommand.MUTE_SET), command);
    } else if (command.equals(OnOffType.ON)) {
        sendCommand(EiscpCommand.getCommandForZone(zone, EiscpCommand.MUTE_SET), command);
    } else if (command.equals(RefreshType.REFRESH)) {
        sendCommand(EiscpCommand.getCommandForZone(zone, EiscpCommand.VOLUME_QUERY));
        sendCommand(EiscpCommand.getCommandForZone(zone, EiscpCommand.MUTE_QUERY));
    }
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:24,代码来源:OnkyoHandler.java


示例9: handleCommand

import org.eclipse.smarthome.core.types.RefreshType; //导入依赖的package包/类
@Override
public void handleCommand(ChannelUID channelUID, Command command) {
    if (RefreshType.REFRESH == command) {
        logger.debug("Refreshing {}...", channelUID);
        switch (channelUID.getId()) {
            case CHANNEL_ID_ARRIVAL:
            case CHANNEL_ID_DEPARTURE:
            case CHANNEL_ID_UPDATE:
                StopHandler stopHandler = getStopHandler();
                if (stopHandler != null) {
                    stopHandler.forceUpdate();
                }
                break;
            default:
                logger.warn("Unnknown channel UID {} with comamnd {}", channelUID.getId(), command);
        }
    } else {
        logger.debug("The OneBusAway route is read-only and can not handle commands.");
    }
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:21,代码来源:RouteHandler.java


示例10: onChannelSendCodeCommand

import org.eclipse.smarthome.core.types.RefreshType; //导入依赖的package包/类
private void onChannelSendCodeCommand(final ChannelUID channelUID, final Command command,
        final ZMoteConfig config) {
    if (!isThingOnline() || (command == null) || (command instanceof RefreshType)) {
        return;
    }

    if ((command != null) && (zmoteService != null)) {
        final String code = command.toString();
        zmoteService.sendCode(config, code);
    }
}
 
开发者ID:alexmaret,项目名称:openhab-binding-zmote,代码行数:12,代码来源:ZMoteHandler.java


示例11: onChannelSendKeyCommand

import org.eclipse.smarthome.core.types.RefreshType; //导入依赖的package包/类
private void onChannelSendKeyCommand(final ChannelUID channelUID, final Command command, final ZMoteConfig config) {
    if (!isThingOnline() || (command == null) || (command instanceof RefreshType)) {
        return;
    }

    if ((command != null) && (zmoteService != null)) {
        final String button = command.toString();
        zmoteService.sendKey(config, button);
    }
}
 
开发者ID:alexmaret,项目名称:openhab-binding-zmote,代码行数:11,代码来源:ZMoteHandler.java


示例12: handleCommand

import org.eclipse.smarthome.core.types.RefreshType; //导入依赖的package包/类
@Override
public void handleCommand(ChannelUID channelUID, Command command) {
    if (command == RefreshType.REFRESH) {
        logger.debug("Refreshing {}", channelUID);
        updateState();
    } else {
        logger.warn("This Thing is read-only and can only handle REFRESH command");
    }
}
 
开发者ID:dfrommi,项目名称:openhab-tado,代码行数:10,代码来源:TadoMobileDeviceHandler.java


示例13: handleCommand

import org.eclipse.smarthome.core.types.RefreshType; //导入依赖的package包/类
@Override
public void handleCommand(ChannelUID channelUID, Command command) {
    String id = channelUID.getId();

    if (command == RefreshType.REFRESH) {
        updateZoneState(false);
        return;
    }

    switch (id) {
        case TadoBindingConstants.CHANNEL_ZONE_HVAC_MODE:
            pendingHvacChange.withHvacMode(((StringType) command).toFullString());
            scheduleHvacChange();
            break;
        case TadoBindingConstants.CHANNEL_ZONE_TARGET_TEMPERATURE:
            pendingHvacChange.withTemperature(((DecimalType) command).floatValue());
            scheduleHvacChange();
            break;
        case TadoBindingConstants.CHANNEL_ZONE_SWING:
            pendingHvacChange.withSwing(((OnOffType) command) == OnOffType.ON);
            scheduleHvacChange();
            break;
        case TadoBindingConstants.CHANNEL_ZONE_FAN_SPEED:
            pendingHvacChange.withFanSpeed(((StringType) command).toFullString());
            scheduleHvacChange();
            break;
        case TadoBindingConstants.CHANNEL_ZONE_OPERATION_MODE:
            String operationMode = ((StringType) command).toFullString();
            pendingHvacChange.withOperationMode(OperationMode.valueOf(operationMode));
            scheduleHvacChange();
            break;
        case TadoBindingConstants.CHANNEL_ZONE_TIMER_DURATION:
            pendingHvacChange.activeFor(((DecimalType) command).intValue());
            scheduleHvacChange();
            break;
    }
}
 
开发者ID:dfrommi,项目名称:openhab-tado,代码行数:38,代码来源:TadoZoneHandler.java


示例14: handleCommand

import org.eclipse.smarthome.core.types.RefreshType; //导入依赖的package包/类
@Override
public void handleCommand(ChannelUID channelUID, Command command) {
    if (command instanceof OnOffType) {
        if (channelUID.getId().equals(CHANNEL_SWITCH)) {
            logger.debug("Switching {} {}", thing.getUID().getAsString(), command.toFullString());
            try {
                plug.sendSwitch((OnOffType) command);
            } catch (IOException e) {
                logger.error("Failed sending command {} to {}", command.toFullString(),
                        thing.getUID().getAsString(), e);
            }
        }
    }

    if (command instanceof RefreshType) {
        boolean success = updateData();
        if (success) {
            switch (channelUID.getId()) {
                case CHANNEL_WATTAGE:
                    updateState(channelUID, getWattage());
                    break;
                case CHANNEL_TOTAL:
                    updateState(channelUID, getTotal());
                    break;
                case CHANNEL_SWITCH:
                    updateState(channelUID, getState());
                    break;
                case CHANNEL_SYSINFO:
                    updateState(channelUID, getSysinfo());
                    break;
                default:
                    logger.debug("Command received for an unknown channel: {}", channelUID.getId());
                    break;
            }
        }
    } else {
        logger.debug("Command {} is not supported for channel: {}", command, channelUID.getId());
    }

}
 
开发者ID:computerlyrik,项目名称:openhab2-addon-hs110,代码行数:41,代码来源:HS110Handler.java


示例15: handleCommand

import org.eclipse.smarthome.core.types.RefreshType; //导入依赖的package包/类
@Override
public void handleCommand(final ChannelUID channelUID, final Command command) {
    logger.debug("{}: Command for channel {} --> {}", nodeIeeeAddress, channelUID, command);

    // Check that we have a coordinator to work through
    if (coordinatorHandler == null) {
        logger.debug("Coordinator handler not found. Cannot handle command without coordinator.");
        updateStatus(ThingStatus.OFFLINE);
        return;
    }

    ZigBeeBaseChannelConverter handler = channels.get(channelUID);
    if (handler == null) {
        logger.debug("No handler found for {}", channelUID);
        return;
    }

    Runnable commandHandler = new Runnable() {
        @Override
        public void run() {
            if (command == RefreshType.REFRESH) {
            } else {
                handler.handleCommand(command);
            }
        }
    };
    scheduler.schedule(commandHandler, 0, TimeUnit.MILLISECONDS);
}
 
开发者ID:openhab,项目名称:org.openhab.binding.zigbee,代码行数:29,代码来源:ZigBeeThingHandler.java


示例16: onChangedWMBusDevice

import org.eclipse.smarthome.core.types.RefreshType; //导入依赖的package包/类
@Override
public void onChangedWMBusDevice(WMBusMessage wmBusDevice) {
    if (wmBusDevice.getSecondaryAddress().getDeviceId().toString().equals(deviceId)) {
        techemDeviceMessage = (TechemHKVMessage) wmBusDevice;
        for (Channel curChan : getThing().getChannels()) {
            handleCommand(curChan.getUID(), RefreshType.REFRESH);
        }
    }

}
 
开发者ID:pokerazor,项目名称:openhab-binding-wmbus,代码行数:11,代码来源:WMBusTechemHKVHandler.java


示例17: handleCommand

import org.eclipse.smarthome.core.types.RefreshType; //导入依赖的package包/类
@Override
public void handleCommand(ChannelUID channelUID, Command command) {
	if (command instanceof RefreshType) {
		logger.debug("Refresh command received.");
		refreshData();
	} else
		logger.warn("No bridge commands defined.");
}
 
开发者ID:Neulinet,项目名称:Zoo,代码行数:9,代码来源:MaxCubeBridgeHandler.java


示例18: handleCommand

import org.eclipse.smarthome.core.types.RefreshType; //导入依赖的package包/类
@Override
public void handleCommand(ChannelUID channelUID, Command command) {
	if (command instanceof RefreshType) {
		logger.debug("Refresh command received.");
		//refreshData(); TODO
	} else
		logger.warn("No bridge commands defined.");
}
 
开发者ID:Neulinet,项目名称:Zoo,代码行数:9,代码来源:Ip2WireBridgeHandler.java


示例19: handleCommand

import org.eclipse.smarthome.core.types.RefreshType; //导入依赖的package包/类
@Override
public void handleCommand(ChannelUID channelUID, Command command) {
    if (command instanceof RefreshType) {
        logger.debug("Refresh command received.");
        rescanTelldusDevices();
    } else {
        logger.warn("No bridge commands defined.");
    }
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:10,代码来源:TelldusCoreBridgeHandler.java


示例20: handleCommand

import org.eclipse.smarthome.core.types.RefreshType; //导入依赖的package包/类
/**
 * Handles an incoming command update
 */
@Override
public void handleCommand(ChannelUID channelUID, Command command) {
    if (command instanceof RefreshType) {
        logger.debug("Refresh command received");
        broadcastLastReceivedTopLevelData();
    }
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:11,代码来源:NestBridgeHandler.java



注:本文中的org.eclipse.smarthome.core.types.RefreshType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ThreadGroupUtils类代码示例发布时间:2022-05-23
下一篇:
Java CityGMLClass类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap