forked from openhab/openhab-addons
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bticinosmarther] Initial contribution (openhab#7533)
Signed-off-by: Fabio Possieri <[email protected]>
- Loading branch information
1 parent
8400422
commit 55adbb0
Showing
65 changed files
with
7,873 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" output="target/classes" path="src/main/java"> | ||
<attributes> | ||
<attribute name="optional" value="true"/> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"> | ||
<attributes> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="src" output="target/test-classes" path="src/test/java"> | ||
<attributes> | ||
<attribute name="optional" value="true"/> | ||
<attribute name="maven.pomderived" value="true"/> | ||
<attribute name="test" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"> | ||
<attributes> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> | ||
<attributes> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="output" path="target/classes"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>org.openhab.binding.bticinosmarther</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.m2e.core.maven2Builder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
<nature>org.eclipse.m2e.core.maven2Nature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
This content is produced and maintained by the openHAB project. | ||
|
||
* Project home: https://www.openhab.org | ||
|
||
== Declared Project Licenses | ||
|
||
This program and the accompanying materials are made available under the terms | ||
of the Eclipse Public License 2.0 which is available at | ||
https://www.eclipse.org/legal/epl-2.0/. | ||
|
||
== Source Code | ||
|
||
https://github.com/openhab/openhab-addons | ||
|
||
Some code of this bundle originates from or was inspired by: | ||
* Tim Waterhouse (Daikin binding) | ||
* Hilbrand Bouwkamp (Spotify binding) |
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file added
BIN
+17 KB
bundles/org.openhab.binding.bticinosmarther/doc/images/application-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.3 KB
bundles/org.openhab.binding.bticinosmarther/doc/images/application-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+47.5 KB
bundles/org.openhab.binding.bticinosmarther/doc/images/tutorial-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.89 KB
bundles/org.openhab.binding.bticinosmarther/doc/images/tutorial-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.openhab.addons.bundles</groupId> | ||
<artifactId>org.openhab.addons.reactor.bundles</artifactId> | ||
<version>2.5.7-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>org.openhab.binding.bticinosmarther</artifactId> | ||
|
||
<name>openHAB Add-ons :: Bundles :: BTicino Smarther Binding</name> | ||
|
||
</project> |
9 changes: 9 additions & 0 deletions
9
bundles/org.openhab.binding.bticinosmarther/src/main/feature/feature.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<features name="org.openhab.binding.bticinosmarther-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0"> | ||
<repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> | ||
|
||
<feature name="openhab-binding-bticinosmarther" description="BTicino Smarther Binding" version="${project.version}"> | ||
<feature>openhab-runtime-base</feature> | ||
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.bticinosmarther/${project.version}</bundle> | ||
</feature> | ||
</features> |
114 changes: 114 additions & 0 deletions
114
.../src/main/java/org/openhab/binding/bticinosmarther/internal/SmartherBindingConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
/** | ||
* Copyright (c) 2010-2020 Contributors to the openHAB project | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.openhab.binding.bticinosmarther.internal; | ||
|
||
import java.util.Collections; | ||
import java.util.Set; | ||
import java.util.stream.Collectors; | ||
import java.util.stream.Stream; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
import org.eclipse.smarthome.core.thing.ThingTypeUID; | ||
|
||
/** | ||
* The {@code SmartherBindingConstants} class defines the common constants used across the whole binding. | ||
* | ||
* @author Fabio Possieri - Initial contribution | ||
*/ | ||
@NonNullByDefault | ||
public class SmartherBindingConstants { | ||
|
||
private static final String BINDING_ID = "bticinosmarther"; | ||
|
||
// Date and time formats used by the binding | ||
public static final String DTF_DATE = "dd/MM/yyyy"; | ||
public static final String DTF_DATETIME = "yyyy-MM-dd'T'HH:mm:ss"; | ||
public static final String DTF_DATETIME_EXT = "yyyy-MM-dd'T'HH:mm:ssXXX"; | ||
public static final String DTF_TODAY = "'Today at' HH:mm"; | ||
public static final String DTF_TOMORROW = "'Tomorrow at' HH:mm"; | ||
public static final String DTF_DAY_HHMM = "dd/MM/yyyy 'at' HH:mm"; | ||
|
||
// Generic constants | ||
public static final String HTTPS_SCHEMA = "https"; | ||
public static final String NAME_SEPARATOR = ", "; | ||
public static final String UNAVAILABLE = "N/A"; | ||
public static final String DEFAULT_PROGRAM = "Default"; | ||
|
||
// List of BTicino/Legrand API gateway related urls, information | ||
public static final String SMARTHER_ACCOUNT_URL = "https://partners-login.eliotbylegrand.com"; | ||
public static final String SMARTHER_AUTHORIZE_URL = SMARTHER_ACCOUNT_URL + "/authorize"; | ||
public static final String SMARTHER_API_TOKEN_URL = SMARTHER_ACCOUNT_URL + "/token"; | ||
public static final String SMARTHER_API_SCOPES = Stream.of("comfort.read", "comfort.write") | ||
.collect(Collectors.joining(" ")); | ||
public static final String SMARTHER_API_URL = "https://api.developer.legrand.com/smarther/v2.0"; | ||
|
||
// Servlets and resources aliases | ||
public static final String AUTH_SERVLET_ALIAS = "/" + BINDING_ID + "/connectsmarther"; | ||
public static final String NOTIFY_SERVLET_ALIAS = "/" + BINDING_ID + "/notifysmarther"; | ||
public static final String IMG_SERVLET_ALIAS = "/img"; | ||
|
||
// List of all Thing Type UIDs | ||
public static final ThingTypeUID THING_TYPE_BRIDGE = new ThingTypeUID(BINDING_ID, "bridge"); | ||
public static final ThingTypeUID THING_TYPE_MODULE = new ThingTypeUID(BINDING_ID, "module"); | ||
|
||
// List of all common properties | ||
public static final String PROPERTY_STATUS_REFRESH_PERIOD = "statusRefreshPeriod"; | ||
|
||
// List of all bridge properties | ||
public static final String PROPERTY_SUBSCRIPTION_KEY = "subscriptionKey"; | ||
public static final String PROPERTY_CLIENT_ID = "clientId"; | ||
public static final String PROPERTY_CLIENT_SECRET = "clientSecret"; | ||
public static final String PROPERTY_NOTIFICATION_URL = "notificationUrl"; | ||
public static final String PROPERTY_NOTIFICATIONS = "notifications"; | ||
|
||
// List of all module properties | ||
public static final String PROPERTY_PLANT_ID = "plantId"; | ||
public static final String PROPERTY_MODULE_ID = "moduleId"; | ||
public static final String PROPERTY_MODULE_NAME = "moduleName"; | ||
public static final String PROPERTY_DEVICE_TYPE = "deviceType"; | ||
|
||
// List of all bridge Status Channel ids | ||
public static final String CHANNEL_STATUS_API_CALLS_HANDLED = "status#apiCallsHandled"; | ||
public static final String CHANNEL_STATUS_NOTIFS_RECEIVED = "status#notifsReceived"; | ||
public static final String CHANNEL_STATUS_NOTIFS_REJECTED = "status#notifsRejected"; | ||
// List of all bridge Config Channel ids | ||
public static final String CHANNEL_CONFIG_FETCH_LOCATIONS = "config#fetchLocations"; | ||
|
||
// List of all module Measures Channel ids | ||
public static final String CHANNEL_MEASURES_TEMPERATURE = "measures#temperature"; | ||
public static final String CHANNEL_MEASURES_HUMIDITY = "measures#humidity"; | ||
// List of all module Status Channel ids | ||
public static final String CHANNEL_STATUS_STATE = "status#state"; | ||
public static final String CHANNEL_STATUS_FUNCTION = "status#function"; | ||
public static final String CHANNEL_STATUS_MODE = "status#mode"; | ||
public static final String CHANNEL_STATUS_TEMPERATURE = "status#temperature"; | ||
public static final String CHANNEL_STATUS_PROGRAM = "status#program"; | ||
public static final String CHANNEL_STATUS_ENDTIME = "status#endTime"; | ||
public static final String CHANNEL_STATUS_TEMP_FORMAT = "status#temperatureFormat"; | ||
// List of all module Settings Channel ids | ||
public static final String CHANNEL_SETTINGS_MODE = "settings#mode"; | ||
public static final String CHANNEL_SETTINGS_TEMPERATURE = "settings#temperature"; | ||
public static final String CHANNEL_SETTINGS_PROGRAM = "settings#program"; | ||
public static final String CHANNEL_SETTINGS_BOOSTTIME = "settings#boostTime"; | ||
public static final String CHANNEL_SETTINGS_ENDDATE = "settings#endDate"; | ||
public static final String CHANNEL_SETTINGS_ENDHOUR = "settings#endHour"; | ||
public static final String CHANNEL_SETTINGS_ENDMINUTE = "settings#endMinute"; | ||
public static final String CHANNEL_SETTINGS_POWER = "settings#power"; | ||
// List of all module Config Channel ids | ||
public static final String CHANNEL_CONFIG_FETCH_PROGRAMS = "config#fetchPrograms"; | ||
|
||
// List of all adressable things | ||
public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections | ||
.unmodifiableSet(Stream.of(THING_TYPE_BRIDGE, THING_TYPE_MODULE).collect(Collectors.toSet())); | ||
|
||
} |
Oops, something went wrong.