当前位置: 首页>>代码示例>>Java>>正文


Java LCDConfig类代码示例

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


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

示例1: setForced

import org.matmaul.freeboxos.lcd.LCDConfig; //导入依赖的package包/类
private void setForced(Command command) throws FreeboxException {
	if (command != null) {
		if (command instanceof OnOffType
				|| command instanceof OpenClosedType
				|| command instanceof UpDownType) {

			LCDConfig lcd = fbClient.getLCDManager().getLCDConfig();
			
			lcd.setOrientationForced( 
					command.equals(OnOffType.ON) || 
					command.equals(UpDownType.UP) || 
					command.equals(OpenClosedType.OPEN)
					);
			fbClient.getLCDManager().setLCDConfig(lcd);	
			fetchLCDConfig();	
		}
	}		
}
 
开发者ID:Neulinet,项目名称:Zoo,代码行数:19,代码来源:FreeboxHandler.java

示例2: fetchLCDConfig

import org.matmaul.freeboxos.lcd.LCDConfig; //导入依赖的package包/类
private void fetchLCDConfig() throws FreeboxException {
	LCDConfig lcdConfiguration = fbClient.getLCDManager().getLCDConfig();
	updateState(new ChannelUID(getThing().getUID(), LCDBRIGHTNESS), 
			new DecimalType(lcdConfiguration.getBrightness()));
	updateState(new ChannelUID(getThing().getUID(), LCDORIENTATION), 
			new DecimalType(lcdConfiguration.getOrientation()));
	updateState(new ChannelUID(getThing().getUID(), LCDFORCED), 
			lcdConfiguration.getOrientationForced() ? OnOffType.ON : OnOffType.OFF);
}
 
开发者ID:Neulinet,项目名称:Zoo,代码行数:10,代码来源:FreeboxHandler.java

示例3: setBrightness

import org.matmaul.freeboxos.lcd.LCDConfig; //导入依赖的package包/类
public void setBrightness(Command command) throws FreeboxException {
	if (command != null) {
			if (command instanceof OnOffType || command instanceof IncreaseDecreaseType || 
				command instanceof DecimalType || command instanceof PercentType) {

				LCDConfig lcd = fbClient.getLCDManager().getLCDConfig();
				int value = 0;
				int newValue = 0;
				
				if (command instanceof IncreaseDecreaseType) {
					value = lcd.getBrightness();
					if (command == IncreaseDecreaseType.INCREASE) {							
						newValue = Math.min(100, value + 1);
					} else {
						newValue = Math.max(0, value - 1);
					}
				} else if (command instanceof OnOffType) {
					newValue = (command == OnOffType.ON) ? 100 : 0;
				} else if (command instanceof DecimalType) {
					newValue = Math.min(100, ((DecimalType) command).intValue());
					newValue = Math.max(newValue, 0);
				} else {
					return;
				}
				lcd.setBrightness(newValue);
				fbClient.getLCDManager().setLCDConfig(lcd);
				fetchLCDConfig();
			}				
	}
}
 
开发者ID:Neulinet,项目名称:Zoo,代码行数:31,代码来源:FreeboxHandler.java

示例4: setOrientation

import org.matmaul.freeboxos.lcd.LCDConfig; //导入依赖的package包/类
private void setOrientation(Command command) throws FreeboxException {
	if (command != null && command instanceof DecimalType) {
		LCDConfig lcd = fbClient.getLCDManager().getLCDConfig();
		int newValue = Math.min(360, ((DecimalType) command).intValue());
		newValue = Math.max(newValue, 0);
		lcd.setOrientation(newValue);
		lcd.setOrientationForced(true);
		fbClient.getLCDManager().setLCDConfig(lcd);	
		fetchLCDConfig();
	}	
}
 
开发者ID:Neulinet,项目名称:Zoo,代码行数:12,代码来源:FreeboxHandler.java

示例5: fetchLCDConfig

import org.matmaul.freeboxos.lcd.LCDConfig; //导入依赖的package包/类
private void fetchLCDConfig() throws FreeboxException {
    LCDConfig lcdConfiguration = fbClient.getLCDManager().getLCDConfig();
    updateState(new ChannelUID(getThing().getUID(), LCDBRIGHTNESS),
            new DecimalType(lcdConfiguration.getBrightness()));
    updateState(new ChannelUID(getThing().getUID(), LCDORIENTATION),
            new DecimalType(lcdConfiguration.getOrientation()));
    updateState(new ChannelUID(getThing().getUID(), LCDFORCED),
            lcdConfiguration.getOrientationForced() ? OnOffType.ON : OnOffType.OFF);
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:10,代码来源:FreeboxHandler.java

示例6: setBrightness

import org.matmaul.freeboxos.lcd.LCDConfig; //导入依赖的package包/类
public void setBrightness(Command command) throws FreeboxException {
    if (command != null) {
        if (command instanceof OnOffType || command instanceof IncreaseDecreaseType
                || command instanceof DecimalType || command instanceof PercentType) {

            LCDConfig lcd = fbClient.getLCDManager().getLCDConfig();
            int value = 0;
            int newValue = 0;

            if (command instanceof IncreaseDecreaseType) {
                value = lcd.getBrightness();
                if (command == IncreaseDecreaseType.INCREASE) {
                    newValue = Math.min(100, value + 1);
                } else {
                    newValue = Math.max(0, value - 1);
                }
            } else if (command instanceof OnOffType) {
                newValue = (command == OnOffType.ON) ? 100 : 0;
            } else if (command instanceof DecimalType) {
                newValue = Math.min(100, ((DecimalType) command).intValue());
                newValue = Math.max(newValue, 0);
            } else {
                return;
            }
            lcd.setBrightness(newValue);
            fbClient.getLCDManager().setLCDConfig(lcd);
            fetchLCDConfig();
        }
    }
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:31,代码来源:FreeboxHandler.java

示例7: setOrientation

import org.matmaul.freeboxos.lcd.LCDConfig; //导入依赖的package包/类
private void setOrientation(Command command) throws FreeboxException {
    if (command != null && command instanceof DecimalType) {
        LCDConfig lcd = fbClient.getLCDManager().getLCDConfig();
        int newValue = Math.min(360, ((DecimalType) command).intValue());
        newValue = Math.max(newValue, 0);
        lcd.setOrientation(newValue);
        lcd.setOrientationForced(true);
        fbClient.getLCDManager().setLCDConfig(lcd);
        fetchLCDConfig();
    }
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:12,代码来源:FreeboxHandler.java

示例8: setForced

import org.matmaul.freeboxos.lcd.LCDConfig; //导入依赖的package包/类
private void setForced(Command command) throws FreeboxException {
    if (command != null) {
        if (command instanceof OnOffType || command instanceof OpenClosedType || command instanceof UpDownType) {

            LCDConfig lcd = fbClient.getLCDManager().getLCDConfig();

            lcd.setOrientationForced(command.equals(OnOffType.ON) || command.equals(UpDownType.UP)
                    || command.equals(OpenClosedType.OPEN));
            fbClient.getLCDManager().setLCDConfig(lcd);
            fetchLCDConfig();
        }
    }
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:14,代码来源:FreeboxHandler.java


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