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.mielecloud.internal.handler;
15 import static org.openhab.binding.mielecloud.internal.MieleCloudBindingConstants.Channels.*;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.binding.mielecloud.internal.handler.channel.ActionsChannelState;
19 import org.openhab.binding.mielecloud.internal.handler.channel.DeviceChannelState;
20 import org.openhab.binding.mielecloud.internal.handler.channel.TransitionChannelState;
21 import org.openhab.core.thing.Thing;
24 * ThingHandler implementation for the Miele hob devices.
26 * @author Roland Edelhoff - Initial contribution
27 * @author Björn Lange - Add channel state wrappers
28 * @author Benjamin Bolte - Add plate step, add info state channel and map signal flags from API
31 public class HobDeviceThingHandler extends AbstractMieleThingHandler {
33 * Creates a new {@link HobDeviceThingHandler}.
35 * @param thing The thing to handle.
37 public HobDeviceThingHandler(Thing thing) {
42 protected void updateDeviceState(DeviceChannelState device) {
43 updateState(channel(OPERATION_STATE), device.getOperationState());
44 updateState(channel(OPERATION_STATE_RAW), device.getOperationStateRaw());
45 updateState(channel(ERROR_STATE), device.getErrorState());
46 updateState(channel(INFO_STATE), device.getInfoState());
47 updateState(channel(PLATE_1_POWER_STEP), device.getPlateStep(0));
48 updateState(channel(PLATE_1_POWER_STEP_RAW), device.getPlateStepRaw(0));
49 updateState(channel(PLATE_2_POWER_STEP), device.getPlateStep(1));
50 updateState(channel(PLATE_2_POWER_STEP_RAW), device.getPlateStepRaw(1));
51 updateState(channel(PLATE_3_POWER_STEP), device.getPlateStep(2));
52 updateState(channel(PLATE_3_POWER_STEP_RAW), device.getPlateStepRaw(2));
53 updateState(channel(PLATE_4_POWER_STEP), device.getPlateStep(3));
54 updateState(channel(PLATE_4_POWER_STEP_RAW), device.getPlateStepRaw(3));
55 updateState(channel(PLATE_5_POWER_STEP), device.getPlateStep(4));
56 updateState(channel(PLATE_5_POWER_STEP_RAW), device.getPlateStepRaw(4));
57 updateState(channel(PLATE_6_POWER_STEP), device.getPlateStep(5));
58 updateState(channel(PLATE_6_POWER_STEP_RAW), device.getPlateStepRaw(5));
62 protected void updateTransitionState(TransitionChannelState transition) {
63 // No state transition required
67 protected void updateActionState(ActionsChannelState actions) {
68 // The Hob device has no trigger actions