2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.loxone.internal.controls;
15 import static org.openhab.binding.loxone.internal.LxBindingConstants.*;
17 import org.openhab.binding.loxone.internal.types.LxUuid;
18 import org.openhab.core.thing.ChannelUID;
19 import org.openhab.core.thing.type.ChannelTypeUID;
20 import org.openhab.core.types.StateDescriptionFragmentBuilder;
23 * A Text State type of control on Loxone Miniserver.
25 * According to Loxone API documentation, a text state represents a State functional block on the Miniserver
27 * @author Pawel Pieczul - initial contribution
30 class LxControlTextState extends LxControl {
32 static class Factory extends LxControlInstance {
34 LxControl create(LxUuid uuid) {
35 return new LxControlTextState(uuid);
45 * A state which will receive an update of possible Text State values)
47 private static final String STATE_TEXT_AND_ICON = "textandicon";
49 private LxControlTextState(LxUuid uuid) {
54 public void initialize(LxControlConfig config) {
55 super.initialize(config);
56 ChannelUID id = addChannel("String", new ChannelTypeUID(BINDING_ID, MINISERVER_CHANNEL_TYPE_RO_TEXT),
57 defaultChannelLabel, "Text state", tags, null, () -> getStateStringValue(STATE_TEXT_AND_ICON));
58 addChannelStateDescriptionFragment(id, StateDescriptionFragmentBuilder.create().withReadOnly(true).build());