Class Lighting


  • public class Lighting
    extends BaseOpenMessage
    OpenWebNet Lighting messages (WHO=1)
    Author:
    M. Valla - Initial contribution
    • Constructor Detail

      • Lighting

        protected Lighting​(String value)
    • Method Detail

      • requestTurnOn

        public static Lighting requestTurnOn​(String where)
        OpenWebNet message request to turn light ON *1*1*WHERE##.
        Parameters:
        where - WHERE string
        Returns:
        message
      • requestTurnOff

        public static Lighting requestTurnOff​(String where)
        OpenWebNet message request to turn light OFF *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 string
        level - What level (0=Off, 1=On, 2-10=level, 30=Up one level, 31=Down one level, 32=Toggle). See Lighting.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 is ON (WHAT=1).
        Returns:
        true if light is ON
      • isOff

        public boolean isOff()
        Verify OpenWebNet message if light is OFF (WHAT=0).
        Returns:
        true if light is OFF
      • parseDimmerLevel100

        public int parseDimmerLevel100()
                                throws FrameException
        Parse 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