]> git.basschouten.com Git - openhab-addons.git/blob
130266299142da442297bb7663ff482fc73e589f
[openhab-addons.git] /
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.shelly.internal.config;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16
17 /**
18  * The {@link ShellyThingConfiguration} class contains fields mapping thing configuration parameters.
19  *
20  * @author Markus Michels - Initial contribution
21  */
22 @NonNullByDefault
23 public class ShellyThingConfiguration {
24     public String deviceIp = ""; // ip address of thedevice
25     public String deviceAddress = ""; // IP address or MAC address for BLU devices
26     public String userId = ""; // userid for http basic auth
27     public String password = ""; // password for http basic auth
28
29     public int updateInterval = 60; // schedule interval for the update job
30     public int lowBattery = 15; // threshold for battery value
31     public boolean brightnessAutoOn = true; // true: turn on device if brightness > 0 is set
32
33     public int favoriteUP = 0; // Roller position favorite when control channel receives ON, 0=none
34     public int favoriteDOWN = 0; // Roller position favorite when control channel receives ON, 0=none
35
36     public boolean eventsButton = false; // true: register for Relay btn_xxx events
37     public boolean eventsSwitch = true; // true: register for device out_xxx events
38     public boolean eventsPush = true; // true: register for short/long push events
39     public boolean eventsRoller = true; // true: register for short/long push events
40     public boolean eventsSensorReport = true; // true: register for sensor events
41     public boolean eventsCoIoT = false; // true: use CoIoT events (based on COAP)
42
43     public String localIp = ""; // local ip addresses used to create callback url
44     public String localPort = "8080";
45     public String serviceName = "";
46
47     public Boolean enableBluGateway = false;
48     public Boolean enableRangeExtender = true;
49
50     @Override
51     public String toString() {
52         return "Device address=" + deviceAddress + ", HTTP user/password=" + userId + "/"
53                 + (password.isEmpty() ? "<none>" : "***") + ", update interval=" + updateInterval + "\n"
54                 + "Events: Button: " + eventsButton + ", Switch (on/off): " + eventsSwitch + ", Push: " + eventsPush
55                 + ", Roller: " + eventsRoller + "Sensor: " + eventsSensorReport + ", CoIoT: " + eventsCoIoT + "\n"
56                 + "Blu Gateway=" + enableBluGateway + ", Range Extender: " + enableRangeExtender;
57     }
58 }