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.opensprinkler.internal;
15 import java.math.BigDecimal;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.core.thing.ThingTypeUID;
21 * The {@link OpenSprinklerBindingConstants} class defines common constants, which are
22 * used across the whole binding.
24 * @author Chris Graham - Initial contribution
25 * @author Florian Schmidt - Split channels to their own things
28 public class OpenSprinklerBindingConstants {
29 public static final String BINDING_ID = "opensprinkler";
30 public static final String DEFAULT_ADMIN_PASSWORD = "opendoor";
31 public static final int DEFAULT_STATION_COUNT = 8;
32 public static final String HTTP_REQUEST_URL_PREFIX = "http://";
33 public static final String HTTPS_REQUEST_URL_PREFIX = "https://";
34 public static final String CMD_ENABLE_MANUAL_MODE = "mm=1";
35 public static final String CMD_DISABLE_MANUAL_MODE = "mm=0";
36 public static final String CMD_PASSWORD = "pw=";
37 public static final String CMD_STATION = "sid=";
38 public static final String CMD_STATION_ENABLE = "en=1";
39 public static final String CMD_STATION_DISABLE = "en=0";
40 public static final String CMD_STATUS_INFO = "jc";
41 public static final String CMD_OPTIONS_INFO = "jo";
42 public static final String CMD_STATION_INFO = "js";
43 public static final String CMD_PROGRAM_DATA = "jp";
44 public static final String CMD_STATION_CONTROL = "cm";
45 public static final String JSON_OPTION_FIRMWARE_VERSION = "fwv";
46 public static final String JSON_OPTION_RAINSENSOR = "rs";
47 public static final String JSON_OPTION_STATION = "sn";
48 public static final String JSON_OPTION_STATION_COUNT = "nstations";
49 public static final String JSON_OPTION_RESULT = "result";
50 public static final int DEFAULT_REFRESH_RATE = 60;
51 public static final int DEFAULT_TIMEOUT = 5;
52 public static final int DEFFAULT_RETRIES = 3;
53 public static final int DISCOVERY_THREAD_POOL_SIZE = 15;
54 public static final boolean DISCOVERY_DEFAULT_AUTO_DISCOVER = false;
55 public static final int DISCOVERY_DEFAULT_TIMEOUT_RATE = 500;
56 public static final int DISCOVERY_DEFAULT_IP_TIMEOUT_RATE = 750;
57 public static final BigDecimal MAX_TIME_SECONDS = new BigDecimal(64800);
59 // List of all Thing ids
60 public static final String HTTP_BRIDGE = "http";
61 public static final String PI_BRIDGE = "pi";
62 public static final String STATION_THING = "station";
63 public static final String DEVICE_THING = "device";
65 // List of all Thing Type UIDs
66 public static final ThingTypeUID OPENSPRINKLER_HTTP_BRIDGE = new ThingTypeUID(BINDING_ID, HTTP_BRIDGE);
67 public static final ThingTypeUID OPENSPRINKLER_STATION = new ThingTypeUID(BINDING_ID, STATION_THING);
68 public static final ThingTypeUID OPENSPRINKLER_DEVICE = new ThingTypeUID(BINDING_ID, DEVICE_THING);
70 // List of all Channel ids
71 public static final String SENSOR_SIGNAL_STRENGTH = "signalStrength";
72 public static final String SENSOR_FLOW_COUNT = "flowSensorCount";
73 public static final String SENSOR_RAIN = "rainsensor";
74 public static final String SENSOR_2 = "sensor2";
75 public static final String SENSOR_WATERLEVEL = "waterlevel";
76 public static final String SENSOR_CURRENT_DRAW = "currentDraw";
77 public static final String CHANNEL_PROGRAMS = "programs";
78 public static final String CHANNEL_ENABLE_PROGRAMS = "enablePrograms";
79 public static final String CHANNEL_STATIONS = "stations";
80 public static final String CHANNEL_RESET_STATIONS = "resetStations";
81 public static final String STATION_STATE = "stationState";
82 public static final String STATION_QUEUED = "queued";
83 public static final String REMAINING_WATER_TIME = "remainingWaterTime";
84 public static final String NEXT_DURATION = "nextDuration";
85 public static final String CHANNEL_IGNORE_RAIN = "ignoreRain";
86 public static final String CHANNEL_RAIN_DELAY = "rainDelay";
87 public static final String CHANNEL_QUEUED_ZONES = "queuedZones";
88 public static final String CHANNEL_CLOUD_CONNECTED = "cloudConnected";
89 public static final String CHANNEL_PAUSE_PROGRAMS = "pausePrograms";