|
| 1 | +/** |
| 2 | + * Copyright (c) 2010-2024 Contributors to the openHAB project |
| 3 | + * |
| 4 | + * See the NOTICE file(s) distributed with this work for additional |
| 5 | + * information. |
| 6 | + * |
| 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 |
| 10 | + * |
| 11 | + * SPDX-License-Identifier: EPL-2.0 |
| 12 | + */ |
| 13 | +package org.openhab.binding.intellifire.internal; |
| 14 | + |
| 15 | +import java.net.URI; |
| 16 | +import java.util.Set; |
| 17 | + |
| 18 | +import org.eclipse.jdt.annotation.NonNullByDefault; |
| 19 | +import org.openhab.core.thing.ThingTypeUID; |
| 20 | + |
| 21 | +/** |
| 22 | + * The {@link IntellifireBindingConstants} class defines common constants, which are |
| 23 | + * used across the whole binding. |
| 24 | + * |
| 25 | + * @author Matt Myers - Initial contribution |
| 26 | + */ |
| 27 | +@NonNullByDefault |
| 28 | +public class IntellifireBindingConstants { |
| 29 | + |
| 30 | + private static final String BINDING_ID = "intellifire"; |
| 31 | + |
| 32 | + // List of all Thing Type UIDs |
| 33 | + public static final ThingTypeUID THING_TYPE_ACCOUNT_BRIDGE = new ThingTypeUID(BINDING_ID, "account"); |
| 34 | + public static final ThingTypeUID THING_TYPE_FAN = new ThingTypeUID(BINDING_ID, "fan"); |
| 35 | + public static final ThingTypeUID THING_TYPE_FIREPLACE = new ThingTypeUID(BINDING_ID, "fireplace"); |
| 36 | + public static final ThingTypeUID THING_TYPE_LIGHT = new ThingTypeUID(BINDING_ID, "light"); |
| 37 | + public static final ThingTypeUID THING_TYPE_REMOTE = new ThingTypeUID(BINDING_ID, "remote"); |
| 38 | + |
| 39 | + public static final Set<ThingTypeUID> BRIDGE_THING_TYPES_UIDS = Set.of(THING_TYPE_ACCOUNT_BRIDGE); |
| 40 | + |
| 41 | + public static final Set<ThingTypeUID> THING_TYPES_UIDS = Set.of(IntellifireBindingConstants.THING_TYPE_FAN, |
| 42 | + IntellifireBindingConstants.THING_TYPE_FIREPLACE, IntellifireBindingConstants.THING_TYPE_LIGHT, |
| 43 | + IntellifireBindingConstants.THING_TYPE_REMOTE); |
| 44 | + |
| 45 | + // List of all Channel ids |
| 46 | + public static final String CHANNEL_FAN = "fan"; |
| 47 | + public static final String CHANNEL_FIREPLACE_POWER = "power"; |
| 48 | + public static final String CHANNEL_FIREPLACE_BATTERY = "battery"; |
| 49 | + public static final String CHANNEL_FIREPLACE_ECMLATENCY = "ecmLatency"; |
| 50 | + public static final String CHANNEL_FIREPLACE_ERRORS = "errors"; |
| 51 | + public static final String CHANNEL_FIREPLACE_FLAMEHEIGHT = "flameHeight"; |
| 52 | + public static final String CHANNEL_FIREPLACE_HOT = "hot"; |
| 53 | + public static final String CHANNEL_FIREPLACE_COLDCLIMATEPILOT = "coldClimatePilot"; |
| 54 | + public static final String CHANNEL_FIREPLACE_PREPURGE = "prePurge"; |
| 55 | + public static final String CHANNEL_LIGHT = "light"; |
| 56 | + public static final String CHANNEL_REMOTE_CONNECTIONQUALITY = "remoteConnectionQuality"; |
| 57 | + public static final String CHANNEL_REMOTE_DOWNTIME = "remoteDowntime"; |
| 58 | + public static final String CHANNEL_REMOTE_ENABLE = "thermostatEnable"; |
| 59 | + public static final String CHANNEL_REMOTE_SETPOINT = "thermostatSetpoint"; |
| 60 | + public static final String CHANNEL_REMOTE_TEMPERATURE = "roomTemperature"; |
| 61 | + public static final String CHANNEL_REMOTE_TIMERENABLE = "timerEnable"; |
| 62 | + public static final String CHANNEL_REMOTE_TIMER = "timer"; |
| 63 | + public static final String CHANNEL_REMOTE_UPTIME = "remoteUptime"; |
| 64 | + |
| 65 | + // Properties |
| 66 | + public static final String PROPERTY_APIKEY = "API Key"; |
| 67 | + public static final String PROPERTY_IPADDRESS = "IP Address"; |
| 68 | + public static final String PROPERTY_LOCATIONID = "Location ID"; |
| 69 | + public static final String PROPERTY_SERIALNUMBER = "Serial Number"; |
| 70 | + public static final String PROPERTY_UNIQUEID = "Unique ID"; |
| 71 | + public static final String PROPERTY_FIREPLACE_BRAND = "Brand"; |
| 72 | + public static final String PROPERTY_FIREPLACE_FIRMWAREVERSION = "Firmware Version"; |
| 73 | + public static final String PROPERTY_FIREPLACE_MODEL = "Model"; |
| 74 | + public static final String PROPERTY_FIREPLACE_NAME = "Name"; |
| 75 | + |
| 76 | + // http Connection |
| 77 | + public static final String HTTP_HEADERS_ACCEPT = "*/*"; |
| 78 | + public static final String HTTP_HEADERS_ACCEPTENCODING = "gzip, deflate"; |
| 79 | + public static final String HTTP_HEADERS_CONNECTION = "keep-alive"; |
| 80 | + public static final String HTTP_HEADERS_CONTENTTYPEURLENCODED = "application/x-www-form-urlencoded"; |
| 81 | + public static final String HTTP_HEADERS_CONTENTTYPETEXT = "text/plain;charset=UTF-8"; |
| 82 | + public static final String HTTP_HEADERS_HOST = "iftapi.net"; |
| 83 | + public static final String HTTP_HEADERS_LANGUAGE = "en-US,en;q=0.9"; |
| 84 | + public static final String URL_LOGIN = "http://iftapi.net/a/login"; |
| 85 | + public static final String URL_ENUMLOCATIONS = "http://iftapi.net/a/enumlocations"; |
| 86 | + public static final String URL_GETUSERNAME = "http://iftapi.net/a/getusername"; |
| 87 | + public static final URI URI_COOKIE = URI.create("http://iftapi.net"); |
| 88 | + |
| 89 | + // polling |
| 90 | + public static final boolean CLOUD_POLLING = true; |
| 91 | + public static final boolean LOCAL_POLLING = false; |
| 92 | +} |
0 commit comments