2 * Copyright (c) 2010-2022 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.mielecloud.internal.handler.channel;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.mielecloud.internal.webservice.api.ActionsState;
17 import org.openhab.core.library.types.OnOffType;
18 import org.openhab.core.types.State;
21 * Wrapper for {@link ActionsState} handling the type conversion to {@link State} for directly filling channels.
23 * @author Björn Lange - Initial Contribution
26 public final class ActionsChannelState {
27 private final ActionsState actions;
29 public ActionsChannelState(ActionsState actions) {
30 this.actions = actions;
33 public State getRemoteControlCanBeSwitchedOn() {
34 return OnOffType.from(actions.canBeSwitchedOn());
37 public State getRemoteControlCanBeSwitchedOff() {
38 return OnOffType.from(actions.canBeSwitchedOff());
41 public State getLightCanBeControlled() {
42 return OnOffType.from(actions.canControlLight());
45 public State getSuperCoolCanBeControlled() {
46 return OnOffType.from(actions.canContolSupercooling());
49 public State getSuperFreezeCanBeControlled() {
50 return OnOffType.from(actions.canControlSuperfreezing());
53 public State getRemoteControlCanBeStarted() {
54 return OnOffType.from(actions.canBeStarted());
57 public State getRemoteControlCanBeStopped() {
58 return OnOffType.from(actions.canBeStopped());
61 public State getRemoteControlCanBePaused() {
62 return OnOffType.from(actions.canBePaused());
65 public State getRemoteControlCanSetProgramActive() {
66 return OnOffType.from(actions.canSetActiveProgramId());