本文整理汇总了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();
}
}
}
示例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);
}
示例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();
}
}
}
示例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();
}
}
示例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);
}
示例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();
}
}
}
示例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();
}
}
示例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();
}
}
}