Class MagicOnOffLightHandler
- All Implemented Interfaces:
- ThingHandler
MagicOnOffLightHandler is responsible for handling commands, which are
 sent to one of the channels.- Author:
- Henning Treu - Initial contribution
- 
Field SummaryFields inherited from class org.openhab.core.thing.binding.BaseThingHandlerscheduler, thing
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidhandleCommand(ChannelUID channelUID, Command command) Handles a command for a given channel.voidInitializes the thing handler, e.g. update thing status, allocate resources, transfer configuration.Methods inherited from class org.openhab.core.thing.binding.BaseThingHandlerbridgeStatusChanged, changeThingType, channelLinked, channelUnlinked, dispose, editConfiguration, editProperties, editThing, getBridge, getCallback, getConfig, getConfigAs, getConfigDescription, getConfigDescription, getThing, handleConfigurationUpdate, handleRemoval, isInitialized, isLinked, isLinked, isModifyingCurrentConfig, postCommand, postCommand, sendTimeSeries, sendTimeSeries, setCallback, thingUpdated, triggerChannel, triggerChannel, triggerChannel, triggerChannel, updateConfiguration, updateProperties, updateProperty, updateState, updateState, updateStatus, updateStatus, updateStatus, updateThing, validateConfigurationParametersMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openhab.core.thing.binding.ThingHandlergetServices
- 
Constructor Details- 
MagicOnOffLightHandler
 
- 
- 
Method Details- 
handleCommandDescription copied from interface:ThingHandlerHandles a command for a given channel.This method is only called, if the thing has been initialized (status ONLINE/OFFLINE/UNKNOWN). - Parameters:
- channelUID- the- ChannelUIDof the channel to which the command was sent
- command- the- Command
 
- 
initializepublic void initialize()Description copied from interface:ThingHandlerInitializes the thing handler, e.g. update thing status, allocate resources, transfer configuration.This method is only called, if the Thingcontains all required configuration parameters.Only Things with statusThingStatus.UNKNOWN,ThingStatus.ONLINEorThingStatus.OFFLINEare considered as initialized by the framework. To achieve that, the status must be reported viaThingHandlerCallback.statusUpdated(Thing, ThingStatusInfo).The framework expects this method to be non-blocking and return quickly. For longer running initializations, the implementation has to take care of scheduling a separate job which must guarantee to set the thing status eventually. Any anticipated error situations should be handled gracefully and need to result in ThingStatus.OFFLINEwith the corresponding status detail (e.g. *COMMUNICATION_ERROR* or *CONFIGURATION_ERROR* including a meaningful description) instead of throwing exceptions.
 
-