Class DimmerItem
- All Implemented Interfaces:
Identifiable<String>,ActiveItem,Item
- Direct Known Subclasses:
ColorItem
- Author:
- Kai Kreuzer - Initial contribution, Markus Rathgeb - Support more types for getStateAs
-
Field Summary
Fields inherited from class org.openhab.core.items.GenericItem
category, eventPublisher, groupNames, itemStateConverter, label, lastState, lastStateChange, lastStateUpdate, listeners, name, state, tags, timeSeriesListeners, type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis method provides a list of all command types that can be used for this itemThis method provides a list of all data types that can be used to update the item statevoidsend(IncreaseDecreaseType command) Send an INCREASE/DECREASE command to the item.voidsend(IncreaseDecreaseType command, @Nullable String source) Send an INCREASE/DECREASE command to the item.voidsend(PercentType command) Send a PercentType command to the item.voidsend(PercentType command, @Nullable String source) Send a PercentType command to the item.voidSet a new state.voidsetTimeSeries(TimeSeries timeSeries) Set a new time series.Methods inherited from class org.openhab.core.library.items.SwitchItem
send, sendMethods inherited from class org.openhab.core.items.GenericItem
addGroupName, addGroupNames, addGroupNames, addStateChangeListener, addTag, addTags, addTags, addTimeSeriesListener, applyState, applyTimeSeries, dispose, equals, getCategory, getCommandDescription, getCommandOptions, getGroupNames, getLabel, getLastState, getLastStateChange, getLastStateUpdate, getName, getState, getStateAs, getStateDescription, getStateDescription, getTags, getType, getUID, hashCode, hasTag, internalSend, isAcceptedState, logSetTypeError, logSetTypeError, notifyListeners, removeAllTags, removeGroupName, removeStateChangeListener, removeTag, removeTimeSeriesListener, send, send, setCategory, setCommandDescriptionService, setEventPublisher, setItemStateConverter, setLabel, setState, setState, setStateDescriptionService, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.openhab.core.items.Item
getCommandDescription
-
Constructor Details
-
DimmerItem
-
-
Method Details
-
send
Send a PercentType command to the item.- Parameters:
command- the command to be sent
-
send
Send a PercentType command to the item.- Parameters:
command- the command to be sentsource- the source of the command. See https://www.openhab.org/docs/developer/utils/events.html#the-core-events
-
send
Send an INCREASE/DECREASE command to the item.- Parameters:
command- the command to be sent
-
send
Send an INCREASE/DECREASE command to the item.- Parameters:
command- the command to be sentsource- the source of the command. See https://www.openhab.org/docs/developer/utils/events.html#the-core-events
-
getAcceptedDataTypes
Description copied from interface:ItemThis 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, andUnDefTypeThe order of data types denotes the order of preference. So in case a state needs to be converted in order to be accepted, it will be attempted to convert it to a type from top to bottom. Therefore the type with the least information loss should be on top of the list - in the example above the
PercentTypecarries more information than the , hence it is listed first.- Specified by:
getAcceptedDataTypesin interfaceItem- Overrides:
getAcceptedDataTypesin classSwitchItem- Returns:
- a list of data types that can be used to update the item state
-
getAcceptedCommandTypes
Description copied from interface:ItemThis 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,- Specified by:
getAcceptedCommandTypesin interfaceItem- Overrides:
getAcceptedCommandTypesin classSwitchItem- Returns:
- a list of all command types that can be used for this item
-
setState
Description copied from class:GenericItemSet a new state. Subclasses may override this method in order to do necessary conversions upfront. Afterwards,GenericItem.applyState(State, String)should be called by classes overriding this method.- Overrides:
setStatein classSwitchItem- Parameters:
state- new state of this itemsource- the source of the state update. See https://www.openhab.org/docs/developer/utils/events.html#the-core-events
-
setTimeSeries
Description copied from class:GenericItemSet a new time series. Subclasses may override this method in order to do necessary conversions upfront. Afterwards,GenericItem.applyTimeSeries(TimeSeries)should be called by classes overriding this method. A time series may only contain events that are compatible with the item's internal state.- Overrides:
setTimeSeriesin classSwitchItem- Parameters:
timeSeries- new time series of this item
-