Class GenericChannelHandler
java.lang.Object
org.openhab.core.thing.internal.binding.generic.converter.AbstractTransformingChannelHandler
org.openhab.core.thing.binding.generic.converter.GenericChannelHandler
- All Implemented Interfaces:
ChannelHandler
@NonNullByDefault
public class GenericChannelHandler
extends org.openhab.core.thing.internal.binding.generic.converter.AbstractTransformingChannelHandler
The
GenericChannelHandler implements simple conversions for different item types- Author:
- Jan N. Klug - Initial contribution
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.openhab.core.thing.binding.generic.ChannelHandler
ChannelHandler.Factory -
Field Summary
Fields inherited from class org.openhab.core.thing.internal.binding.generic.converter.AbstractTransformingChannelHandler
channelConfig -
Constructor Summary
ConstructorsConstructorDescriptionGenericChannelHandler(Function<String, State> toState, Consumer<State> updateState, Consumer<Command> postCommand, @Nullable Consumer<String> sendValue, ChannelTransformation stateTransformations, ChannelTransformation commandTransformations, ChannelValueConverterConfig channelConfig) -
Method Summary
Methods inherited from class org.openhab.core.thing.internal.binding.generic.converter.AbstractTransformingChannelHandler
process, send
-
Constructor Details
-
GenericChannelHandler
public GenericChannelHandler(Function<String, State> toState, Consumer<State> updateState, Consumer<Command> postCommand, @Nullable Consumer<String> sendValue, ChannelTransformation stateTransformations, ChannelTransformation commandTransformations, ChannelValueConverterConfig channelConfig)
-
-
Method Details
-
toState
Description copied from class:org.openhab.core.thing.internal.binding.generic.converter.AbstractTransformingChannelHandlerconvert the received value to a state- Specified by:
toStatein classorg.openhab.core.thing.internal.binding.generic.converter.AbstractTransformingChannelHandler- Parameters:
value- the value- Returns:
- the state that represents the value of UNDEF if conversion failed
-
toCommand
Description copied from class:org.openhab.core.thing.internal.binding.generic.converter.AbstractTransformingChannelHandlercheck if this converter received a value that needs to be sent as command- Specified by:
toCommandin classorg.openhab.core.thing.internal.binding.generic.converter.AbstractTransformingChannelHandler- Parameters:
value- the value- Returns:
- the command or null
-
toString
Description copied from class:org.openhab.core.thing.internal.binding.generic.converter.AbstractTransformingChannelHandlerconvert a command to a string- Specified by:
toStringin classorg.openhab.core.thing.internal.binding.generic.converter.AbstractTransformingChannelHandler- Parameters:
command- the command- Returns:
- the string representation of the command
-