Package org.openhab.core.thing.type
Interface DynamicStateDescriptionProvider
- All Known Implementing Classes:
BaseDynamicStateDescriptionProvider
@NonNullByDefault
public interface DynamicStateDescriptionProvider
The
DynamicStateDescriptionProvider
is responsible for providing StateDescription
for a
Channel
dynamically in the runtime. Therefore the provider must be registered as OSGi service.- Author:
- Pawel Pieczul - Initial contribution
-
Method Summary
Modifier and TypeMethodDescription@Nullable StateDescription
getStateDescription
(Channel channel, @Nullable StateDescription originalStateDescription, @Nullable Locale locale) For a givenChannel
, return aStateDescription
that should be used for the channel, instead of the one defined statically in theChannelType
.
-
Method Details
-
getStateDescription
@Nullable StateDescription getStateDescription(Channel channel, @Nullable StateDescription originalStateDescription, @Nullable Locale locale) For a givenChannel
, return aStateDescription
that should be used for the channel, instead of the one defined statically in theChannelType
. For a particular channel, there should be only one provider of the dynamic state description. When more than one description is provided for the same channel (by different providers), only one will be used, from the provider that registered first. If the given channel will not be managed by the provider null should be returned. You never must return the original state description in such case.- Parameters:
channel
- channeloriginalStateDescription
- original state description retrieved from the channel type this is the description to be replaced by the provided onelocale
- locale (can be null)- Returns:
- state description or null if none provided
-