Package org.openwebnet4j.message
Class Lighting
- java.lang.Object
 - 
- org.openwebnet4j.message.OpenMessage
 - 
- org.openwebnet4j.message.BaseOpenMessage
 - 
- org.openwebnet4j.message.Lighting
 
 
 
 
- 
public class Lighting extends BaseOpenMessage
OpenWebNet Lighting messages (WHO=1)- Author:
 - M. Valla - Initial contribution
 
 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLighting.DIMstatic classLighting.WHAT 
- 
Field Summary
Fields Modifier and Type Field Description static intDIMMER_LEVEL_100_MAXstatic intDIMMER_LEVEL_100_OFF- 
Fields inherited from class org.openwebnet4j.message.BaseOpenMessage
FORMAT_DIMENSION_REQUEST, FORMAT_DIMENSION_WRITING_1P_1V, FORMAT_DIMENSION_WRITING_1V, FORMAT_DIMENSION_WRITING_2V, FORMAT_REQUEST, FORMAT_STATUS, MAX_FRAME_LENGTH, where, whereStr, who 
- 
Fields inherited from class org.openwebnet4j.message.OpenMessage
FRAME_ACK, FRAME_ACK_NACK_BUSY_START, FRAME_BUSY_NACK, FRAME_END, FRAME_NACK, FRAME_START, FRAME_START_DIM, frameValue 
 - 
 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description OpenDeviceTypedetectDeviceType()Tries to return aOpenDeviceTypebased on frame valueprotected DimdimFromValue(int i)booleanisOff()Verify OpenWebNet message if light isOFF(WHAT=0).booleanisOn()Verify OpenWebNet message if light isON(WHAT=1).static intlevelToPercent(int level)Transforms a 0-10 level (int) to a percent (0-100)intparseDimmerLevel100()Parse dimmerLevel100 (DIM: 1)protected voidparseWhere()Parse WHERE and assigns it toBaseOpenMessage.whereattributestatic WhatpercentToWhat(int percent)Return WHAT corresponding to the brightness percent.static LightingrequestDimTo(String where, What level)OpenWebNet message request to dim light to level*1*level*WHERE##.static LightingrequestStatus(String where)OpenWebNet message request light status*#1*WHERE##.static LightingrequestTurnOff(String where)OpenWebNet message request to turn lightOFF*1*0*WHERE##.static LightingrequestTurnOn(String where)OpenWebNet message request to turn lightON*1*1*WHERE##.protected WhatwhatFromValue(int i)- 
Methods inherited from class org.openwebnet4j.message.BaseOpenMessage
addValues, getCommandParams, getDim, getDimParams, getDimValues, getWhat, getWhere, getWho, isCommand, isCommandTranslation, isDimWriting, parse, toStringVerbose 
- 
Methods inherited from class org.openwebnet4j.message.OpenMessage
equals, getFrameValue, isACK, isBUSY_NACK, isNACK, toString 
 - 
 
 - 
 
- 
- 
Field Detail
- 
DIMMER_LEVEL_100_OFF
public static final int DIMMER_LEVEL_100_OFF
- See Also:
 - Constant Field Values
 
 
- 
DIMMER_LEVEL_100_MAX
public static final int DIMMER_LEVEL_100_MAX
- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Constructor Detail
- 
Lighting
protected Lighting(String value)
 
 - 
 
- 
Method Detail
- 
whatFromValue
protected What whatFromValue(int i)
- Specified by:
 whatFromValuein classBaseOpenMessage
 
- 
dimFromValue
protected Dim dimFromValue(int i)
- Specified by:
 dimFromValuein classBaseOpenMessage
 
- 
requestTurnOn
public static Lighting requestTurnOn(String where)
OpenWebNet message request to turn lightON*1*1*WHERE##.- Parameters:
 where- WHERE string- Returns:
 - message
 
 
- 
requestTurnOff
public static Lighting requestTurnOff(String where)
OpenWebNet message request to turn lightOFF*1*0*WHERE##.- Parameters:
 where- WHERE string- Returns:
 - message
 
 
- 
requestDimTo
public static Lighting requestDimTo(String where, What level)
OpenWebNet message request to dim light to level*1*level*WHERE##.- Parameters:
 where- WHERE stringlevel- What level (0=Off, 1=On, 2-10=level, 30=Up one level, 31=Down one level, 32=Toggle). SeeLighting.WHAT- Returns:
 - message
 
 
- 
requestStatus
public static Lighting requestStatus(String where)
OpenWebNet message request light status*#1*WHERE##.- Parameters:
 where- WHERE string- Returns:
 - message
 
 
- 
isOn
public boolean isOn()
Verify OpenWebNet message if light isON(WHAT=1).- Returns:
 - true if light is ON
 
 
- 
isOff
public boolean isOff()
Verify OpenWebNet message if light isOFF(WHAT=0).- Returns:
 - true if light is OFF
 
 
- 
parseDimmerLevel100
public int parseDimmerLevel100() throws FrameExceptionParse dimmerLevel100 (DIM: 1)- Returns:
 - corresponding int percentage (0-100)
 - Throws:
 FrameException- in case of frame error
 
- 
levelToPercent
public static int levelToPercent(int level)
Transforms a 0-10 level (int) to a percent (0-100)- Parameters:
 level- 0-10- Returns:
 - int percent
 
 
- 
percentToWhat
public static What percentToWhat(int percent)
Return WHAT corresponding to the brightness percent.- Parameters:
 percent- 0-100- Returns:
 - What level (2-10) corresponding to percent
 
 
- 
parseWhere
protected void parseWhere() throws FrameExceptionDescription copied from class:BaseOpenMessageParse WHERE and assigns it toBaseOpenMessage.whereattribute- Specified by:
 parseWherein classBaseOpenMessage- Throws:
 FrameException- in case of error in frame
 
- 
detectDeviceType
public OpenDeviceType detectDeviceType()
Description copied from class:BaseOpenMessageTries to return aOpenDeviceTypebased on frame value- Specified by:
 detectDeviceTypein classBaseOpenMessage- Returns:
 - recognized device type or null if not device can be recognized
 
 
 - 
 
 -