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.netatmo.internal.handler.channelhelper;
15 import static org.openhab.binding.netatmo.internal.NetatmoBindingConstants.CHANNEL_FLOODLIGHT;
16 import static org.openhab.binding.netatmo.internal.utils.ChannelTypeUtils.toStringType;
20 import org.eclipse.jdt.annotation.NonNullByDefault;
21 import org.eclipse.jdt.annotation.Nullable;
22 import org.openhab.binding.netatmo.internal.api.dto.HomeStatusModule;
23 import org.openhab.binding.netatmo.internal.api.dto.NAThing;
24 import org.openhab.core.config.core.Configuration;
25 import org.openhab.core.types.State;
28 * The {@link PresenceChannelHelper} handles specific channels of Presence external cameras
30 * @author Gaƫl L'hopital - Initial contribution
34 public class PresenceChannelHelper extends CameraChannelHelper {
36 public PresenceChannelHelper(Set<String> providedGroups) {
37 super(providedGroups);
41 protected @Nullable State internalGetProperty(String channelId, NAThing naThing, Configuration config) {
42 if (naThing instanceof HomeStatusModule) {
43 HomeStatusModule camera = (HomeStatusModule) naThing;
45 case CHANNEL_FLOODLIGHT:
46 return toStringType(camera.getFloodlight());
49 return super.internalGetProperty(channelId, naThing, config);