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.amazonechocontrol.internal.smarthome;
17 import java.util.function.Function;
19 import org.eclipse.jdt.annotation.NonNullByDefault;
20 import org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants;
21 import org.openhab.binding.amazonechocontrol.internal.handler.SmartHomeDeviceHandler;
22 import org.openhab.core.thing.type.ChannelTypeUID;
25 * @author Michael Geramb - Initial contribution
28 public class Constants {
29 public static final Map<String, Function<SmartHomeDeviceHandler, HandlerBase>> HANDLER_FACTORY = Map.ofEntries(
30 Map.entry(HandlerPowerController.INTERFACE, HandlerPowerController::new),
31 Map.entry(HandlerBrightnessController.INTERFACE, HandlerBrightnessController::new),
32 Map.entry(HandlerColorController.INTERFACE, HandlerColorController::new),
33 Map.entry(HandlerColorTemperatureController.INTERFACE, HandlerColorTemperatureController::new),
34 Map.entry(HandlerSecurityPanelController.INTERFACE, HandlerSecurityPanelController::new),
35 Map.entry(HandlerAcousticEventSensor.INTERFACE, HandlerAcousticEventSensor::new),
36 Map.entry(HandlerTemperatureSensor.INTERFACE, HandlerTemperatureSensor::new),
37 Map.entry(HandlerThermostatController.INTERFACE, HandlerThermostatController::new),
38 Map.entry(HandlerPercentageController.INTERFACE, HandlerPercentageController::new),
39 Map.entry(HandlerPowerLevelController.INTERFACE, HandlerPowerLevelController::new),
40 Map.entry(HandlerHumiditySensor.INTERFACE, HandlerHumiditySensor::new));
42 public static final Set<String> SUPPORTED_INTERFACES = HANDLER_FACTORY.keySet();
45 public static final ChannelTypeUID CHANNEL_TYPE_TEMPERATURE = new ChannelTypeUID(
46 AmazonEchoControlBindingConstants.BINDING_ID, "temperature");
47 public static final ChannelTypeUID CHANNEL_TYPE_HUMIDITY = new ChannelTypeUID(
48 AmazonEchoControlBindingConstants.BINDING_ID, "relativeHumidity");
49 public static final ChannelTypeUID CHANNEL_TYPE_TARGETSETPOINT = new ChannelTypeUID(
50 AmazonEchoControlBindingConstants.BINDING_ID, "targetSetpoint");
51 public static final ChannelTypeUID CHANNEL_TYPE_LOWERSETPOINT = new ChannelTypeUID(
52 AmazonEchoControlBindingConstants.BINDING_ID, "lowerSetpoint");
53 public static final ChannelTypeUID CHANNEL_TYPE_UPPERSETPOINT = new ChannelTypeUID(
54 AmazonEchoControlBindingConstants.BINDING_ID, "upperSetpoint");
55 public static final ChannelTypeUID CHANNEL_TYPE_THERMOSTATMODE = new ChannelTypeUID(
56 AmazonEchoControlBindingConstants.BINDING_ID, "thermostatMode");
57 public static final ChannelTypeUID CHANNEL_TYPE_FAN_OPERATION = new ChannelTypeUID(
58 AmazonEchoControlBindingConstants.BINDING_ID, "fanOperation");
59 public static final ChannelTypeUID CHANNEL_TYPE_COOLER_OPERATION = new ChannelTypeUID(
60 AmazonEchoControlBindingConstants.BINDING_ID, "coolerOperation");
63 public static final String ITEM_TYPE_SWITCH = "Switch";
64 public static final String ITEM_TYPE_DIMMER = "Dimmer";
65 public static final String ITEM_TYPE_STRING = "String";
66 public static final String ITEM_TYPE_NUMBER = "Number";
67 public static final String ITEM_TYPE_NUMBER_TEMPERATURE = "Number:Temperature";
68 public static final String ITEM_TYPE_HUMIDITY = "Number:Dimensionless";
69 public static final String ITEM_TYPE_CONTACT = "Contact";
70 public static final String ITEM_TYPE_COLOR = "Color";