Class ColorItem

  • All Implemented Interfaces:
    Item

    public class ColorItem
    extends DimmerItem
    A ColorItem can be used for color values, e.g. for LED lights
    Author:
    Kai Kreuzer - Initial contribution
    • Constructor Detail

      • ColorItem

        public ColorItem​(String name)
    • Method Detail

      • send

        public void send​(HSBType command)
      • getAcceptedDataTypes

        public List<Class<? extends State>> getAcceptedDataTypes()
        Description copied from interface: Item

        This method provides a list of all data types that can be used to update the item state

        Imagine e.g. a dimmer device: It's status could be 0%, 10%, 50%, 100%, but also OFF or ON and maybe UNDEFINED. So the accepted data types would be in this case PercentType, OnOffType and UnDefType

        Specified by:
        getAcceptedDataTypes in interface Item
        Overrides:
        getAcceptedDataTypes in class DimmerItem
        Returns:
        a list of data types that can be used to update the item state
      • getAcceptedCommandTypes

        public List<Class<? extends Command>> getAcceptedCommandTypes()
        Description copied from interface: Item

        This method provides a list of all command types that can be used for this item

        Imagine e.g. a dimmer device: You could ask it to dim to 0%, 10%, 50%, 100%, but also to turn OFF or ON. So the accepted command types would be in this case PercentType, OnOffType

        Specified by:
        getAcceptedCommandTypes in interface Item
        Overrides:
        getAcceptedCommandTypes in class DimmerItem
        Returns:
        a list of all command types that can be used for this item
      • getStateAs

        public State getStateAs​(Class<? extends State> typeClass)
        Description copied from interface: Item
        returns the current state of the item as a specific type
        Specified by:
        getStateAs in interface Item
        Overrides:
        getStateAs in class DimmerItem
        Returns:
        the current state in the requested type or null, if state cannot be provided as the requested type