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.yeelight.internal.handler;
15 import org.openhab.binding.yeelight.internal.YeelightBindingConstants;
16 import org.openhab.binding.yeelight.internal.lib.device.DeviceStatus;
17 import org.openhab.binding.yeelight.internal.lib.enums.ActiveMode;
18 import org.openhab.core.library.types.OnOffType;
19 import org.openhab.core.thing.Thing;
22 * The {@link YeelightCeilingWithNightHandler} is responsible for handling commands, which are
23 * sent to one of the channels.
25 * @author Nikita Pogudalov - Initial contribution
27 public class YeelightCeilingWithNightHandler extends YeelightCeilingHandler {
29 public YeelightCeilingWithNightHandler(Thing thing) {
34 protected void updateUI(DeviceStatus status) {
35 super.updateUI(status);
37 updateState(YeelightBindingConstants.CHANNEL_NIGHTLIGHT,
38 OnOffType.from((status.getActiveMode() == ActiveMode.MOONLIGHT_MODE)));